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

authorize module never resolves after successful login on Android #977

Open
6 tasks done
DigohD opened this issue Sep 23, 2024 · 8 comments
Open
6 tasks done

authorize module never resolves after successful login on Android #977

DigohD opened this issue Sep 23, 2024 · 8 comments
Labels
bug This points to a verified bug in the code

Comments

@DigohD
Copy link

DigohD commented Sep 23, 2024

Checklist

Description

We've created a barebones React Native project, only implementing the instructions of the quickstart guide in the auth0 dashboard. The login browser module which opens with aurhorize() works as intended, except for when a correct login is entered.

In the Auth0 dashboard logs we can see that registration, email verification and login are successful. But the login module never resolves in the application, and nothing happens after a successful login.

Callback URL configured in the dashboard for the app is:
com.authnullte.auth0://digohd.eu.auth0.com/android/com.authnullte/callback

This seems to be correct, since the module does not load at all if we change it.

Reproduction

  1. clone https://github.com/DigohD/auth0-react-native-minimal-repro
  2. install node modules (npm i)
  3. run app on Android device/emulator (npx react-native run-android)
  4. Within the started app, press "Log in"
  5. Register an account via auth0 module and try to log in
  6. if correct credentials are provided, the loading bar of the browser appears and the window is then stuck. Nothing more happens

This is reproducible for all 3 of our develpers who have tried to solve the issue.

Additional context

If we add:

<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
  android:host="digohd.eu.auth0.com"
  android:pathPrefix="/android/${applicationId}/callback"
  android:scheme="${applicationId}.auth0" />

To the AndroidManifest.xml the module resolves after login and we're returned to the application as expected. However, credentials are undefined, either when checking the promise handling argument authorize(...).then(...), or when using getCredentials() provided by useAuth0() hook. We tried both after awaiting authorization and not awaiting.

react-native-auth0 version

3.2.1 and 4.0.0-beta.0

React Native version

0.74.3 and 0.75.3

Expo version

none

Platform

Android

Platform version(s)

14

@DigohD DigohD added the bug This points to a verified bug in the code label Sep 23, 2024
@fabianbru
Copy link

fabianbru commented Oct 18, 2024

We also experiencing a similar or the same issue with an existing app. There was no change in the code or in the configuration.

During webAuth.authorize the in-app browser opens the login page. After submitting nothing happens and the browser window doesn't close or redirect back to the app.
When I manually close the window and try again to webAuth.authorize then the page is empty/white and no login form is visible. This happens till I run webAuth.clearSession (which also stuck with open in-app browser page). Afterwards I see the form again, but it will stuck on submit like at the beginning. There is a "Successful Login" entry in the Auth0 logs.

What I have tried so far, but all result the same:

  • use Auth0 class or use Provider and Hooks
  • use up-to-date "react-native-auth0" package and also try 4.0.0-beta.0
  • use Universal Login or Custom Login page
  • remove Actions

Due to the fact, that is was functional in the past, it looks like the issue comes from a change made by Auth0 or Android/Chrome?

Does someone have a glue?

@fabianbru
Copy link

Found the issue in the code: Our auth0Scheme in build.gradle was missing the .auth0 ending like described in the migration guide

@tusharpandey13
Copy link

Closing this as a root cause and fix has been found.

@DigohD
Copy link
Author

DigohD commented Oct 21, 2024

Happy to see you got is solved @fabianbru but in our case we have included the ".auth0" part of the scheme and still experience the issue described in the original ticket @tusharpandey13

@BrianZanti
Copy link

@tusharpandey13 What was the root cause and fix? We are having the same issue described by @DigohD. It doesn't look like there are any newer versions of the sdk which might include a fix.

@AlixH
Copy link

AlixH commented Nov 27, 2024

Same error here ! Please @tusharpandey13 reopen this issue

@tusharpandey13
Copy link

I have reopened the issue as the issue is still there. I'll fwd this to the POC for react native from our SDK team but right now we cannot comment on a timeline for fix.
But please note that this has been bumped.
Also, a new react native SDK for Auth0 is in the works and will definitely have this fix incorporated but again, cannot comment on timelines for it.

@AlixH
Copy link

AlixH commented Nov 27, 2024

@DigohD, @tusharpandey13 I managed to fix the issue by overriding the default RedirectActivity as explained here:
#931
Hope this helps you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This points to a verified bug in the code
Projects
None yet
Development

No branches or pull requests

5 participants