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

Andorid React not authenticated after returning to app #698

Open
4 tasks done
himynameistim opened this issue Jun 26, 2024 · 1 comment
Open
4 tasks done

Andorid React not authenticated after returning to app #698

himynameistim opened this issue Jun 26, 2024 · 1 comment

Comments

@himynameistim
Copy link

Checklist

  • I have looked into the Readme (React/Angular/Vue) and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Description

I have downloaded the sample for React and tested using an Android device.

Clicking login correctly loads the Auth0 login page in a browser and after entering credentials the user is taken back to the app, however they're still not authenticated.

Clicking login a second time redirects to auth0 which immediately redirects back to the app, but the app still shows the user as unauthenticated.

Reproduction

  1. Download sample with auth0 account logged in
  2. Add allowed urls to auth0 application settings
  3. Complete npm install etc instructions
  4. Open app in Android Studio and generate app package
  5. Deploy to device (I'm using real devices via lambda test)
  6. Login

Additional context

No response

Sample

React

Platform

Android

Platform version(s)

13

@himynameistim
Copy link
Author

Figured this out. The instructions specify to set Allowed origins and by default there is a property named Allowed web origins in the Auth0 Application settings.

However in addition to this Cross-Origin Authentication needs to be switched on and the following domains added to Allowed Origins (CORS)

capacitor://localhost, http://localhost, http://localhost:3000/, https://localhost

If you don't do this the following error will appear in the logs.

Origin https://localhost is not allowed. Behavior used for check: LEGACY

The documentation could be updated to make this clearer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant