Getting the oauth response in RedirectUriReceiverActivity
See original GitHub issueHi,
Im creating an app that logs into my elixir backend server using oauth. I can do the request, get redirected and I can see that I’m logged in and receive my token from the server. However, I never get redirected back to the app and when I click back I always end up in handleAuthorizationCanceled(). I read that I need to set up my “scheme” in the manifest or build settings but I dont understand at all what that is… Im talking about this part:
<data android:scheme="https"
android:host="www.example.com"
android:path="/oauth2redirect"/>
Should I put my app’s url here? It currently runs locally on my laptop so I acces it via the emulator with http://10.0.2.2:4000 What should I put in here? Nothing I try seems to work.
Oh and I saw people saying put in com.googleusercontent.apps.<MY_ID_ADDED_HERE>, but my app is a github app, not google. Thanks in advance
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
GitHub does not support redirect to a custom scheme redirect URI, they only support redirect to https URIs last I checked. Custom scheme URIs look like
com.your.app://oauth2redirect
, where thecom.your.app
part is the custom scheme.I have a demo of GitHub integration here:
https://github.com/iainmcgin/AppAuth-Demo
Please read the caveats about security carefully. GitHub also requires the use of a static client secret, which is not advisable for mobile apps. I give some advice on that demo repository page as to how to integrate with GitHub securely, but it is not trivial and requires backend work.
Thanks