question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting the oauth response in RedirectUriReceiverActivity

See original GitHub issue

Hi,

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:closed
  • Created 7 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
iainmcgincommented, Feb 8, 2017

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 the com.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.

0reactions
nycodes9commented, Feb 9, 2017

Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

onActivityResult doesn't call for getting response in AppAuth ...
I use AppAuth library(https://github.com/openid/AppAuth-Android) for oauth authorization code flow ...
Read more >
Authenticating on Android with the AppAuth Library - Medium
To get started with Google OAuth, you will need to first go to the Google Cloud ... This response (example shown below) will...
Read more >
OAuth 2.0 for Mobile & Desktop Apps - YouTube
Obtaining OAuth 2.0 access tokens ... When your app receives the authorization response, for best usability it should respond by displaying ...
Read more >
AppAuth Android - Gluu Server 3.1.0 Docs
AppAuth for Android is a client SDK for communicating with OAuth 2.0 and OpenID ... When the response is captured by RedirectUriReceiverActivity ,...
Read more >
Authorize your Android App with AppAuth and Identity Server 3
When clicking on the login button, you are getting redirected to a web ... AppAuth is a powerful library communicating with OAuth 2.0...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found