Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebAuthProvider Is not working after trying to login after the first load #488

Closed
alaa-test-2 opened this issue Jun 13, 2021 · 4 comments
Closed
Labels
waiting for customer This issue is waiting for a response from the issue or PR author

Comments

@alaa-test-2
Copy link

Describe the problem

I'm trying to implement the universal login using WebAuthProvider, when I run it for the first time, I can see the login screen, but then when I tried to login, I'm redirected to page not found, if I run the app again, I will see page not found

What was the expected behavior?

I should be able to login and see the login screen after the first time

Reproduction

WebAuthProvider
            .login(account)
            .withScope("openid profile email offline_access")
            .withAudience("https://${BuildConfig.AUTH0_DOMAIN}/userinfo")
            .start(this@LoginActivity, loginCallback)

Running this code, will be able to see the login screen. Not able to login, and any attempts afterword will see not found screen, no errors in the logcat

Screenshot_20210613-233253_Samsung Internet

Environment

  • Version of this library used:
    implementation 'com.auth0.android:auth0:2.2.0'
  • Any other relevant information you think would be useful:
  • I tried to test it in both the emulator Pixel 3A api 30 and Samsung s20 api30
@lbalmaceda
Copy link
Contributor

That's the browser app blocking the redirect and is out of the scope of what this SDK can do to help prevent that. Ideally, there would be content in that callback page that the user could click to get back to your app, as a fallback in case this happens.

The easiest way to solve this is to use a custom scheme Redirect URL instead of an "https" one, following the steps here.

To our knowledge, the hard way to solve this, if you want to keep using "Android App Links", is to host content in that Redirect URL that will have a link/button as fallback using a custom scheme, as above. Your app would need to re-declare the RedirectActivity entry in the manifest with one intent filter having 2 different "data" parts. One for "https" and one for the custom scheme you choose.

@lbalmaceda lbalmaceda added the waiting for customer This issue is waiting for a response from the issue or PR author label Jun 17, 2021
@MackHartley
Copy link

MackHartley commented Jun 24, 2021

Hi folks, I just want to confirm that I also am experiencing this issue. I can't seem to find any way around it. I've even deleted my Auth0 API and made a new one but I see the same behavior.

Also I am not using an https scheme. I'm using demo

Edit:
Found the issue. I had followed this tutorial:
https://auth0.com/docs/libraries/auth0-android

Then continued on using this tutorial:
https://auth0.com/docs/quickstart/native/android

They use different schemes. The first uses https and the second uses demo. Because of that certain areas of my app were using different schemes. It might be less confusing to keep all tutorials unified on a specific scheme. Perhaps there was a reason for that though.

@lbalmaceda
Copy link
Contributor

@MackHartley thanks for the feedback and apologies for the confusion. The reason the library article shows how to use "https" is that that's the default scheme value that the WebAuthProvider is configured with. Meaning that unless you decide to change that, you don't have to specify a new scheme using the builder class. We try to document the simplest approach for libraries' main articles and explore a bit more the use cases from the quickstart articles.

@lbalmaceda
Copy link
Contributor

@alaa-test-2 I'm going to close this now. If you have further questions feel free to leave a reply here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for customer This issue is waiting for a response from the issue or PR author
Projects
None yet
Development

No branches or pull requests

3 participants