Redirect Fails: Site can’t be reached after upgrade to 3.0

Resubmitting this thread as never recieved an aswer:

Migrated to 3.0 and while IOS works just fine, android fails to complete the authorization process and provide an accessToken

The readme states that the Intent Filters are no longer required for the redirect but if I remove them, I get an error after submiting credentials saying " The site can’t be reached’.

Adding the intent filters solves this error, but then the auth0.webAuth.authorize method still fails to trigger the callback. In otherwords, .authorize() fails to completely resolve, and my .then() fail to print anything afterwards.

I have recreated the issue using the sample project. Has anyone encountered this issue and resolved it?

Hi @Flotemer,

What did you migrate you 3.0? Could you please share a bit more info about it?

Thank you!

Yes,
I migrated to react-native-auth-0 version 3.0. Before that, the android login was failing due to an issue with react native navigation preventing the callback from occuring properly.

I have re-created the exact same issue with the example project. The callback works in the sense that the callback re-opens the application after completing the sign in, however, the callback function never completes and pulls the credentials from the redirect.

 try {
        await authorize({}, {});
        console.log('authorization completed');
        const credentials = await getCredentials();
        Alert.alert('AccessToken: ' + credentials?.accessToken);
    } catch (error) {
        console.error('Authorization error: ', error);
    }

In other words, while the redirect occurs, neither ‘authorization completed’, or ‘authorization error’, is ever printed to console, so credentials are never retrieved and displayed in the alert.

IOS works fine, just android.

Hi @Flotemer,

Have you gone through the migration guide?

Specifically, the callback URL changes? Also, can you confirm if you are using Expo in your project? It looks like part of the migration includes some support for legacy callback URLs if you are not using Expo (Please see the above link for more info).

Thanks,
Dan

Hey Dan

Yes, I had gone through the migration guide, and changed the callback url as required, after updating the url. Nor am not using expo in my project.

To confirm, I just re cloned the auth0-react-native-sample project again and configured according to the readme from scratch and still no luck with fresh start…After logging in, still getting “This site can’t be reached” in android…ios works fine.

Build.gradle:

manifestPlaceholders = [auth0Domain: "https://dev-6grfdf7yl20x0nrn.us.auth0.com", 
        auth0Scheme: "${applicationId}.auth0"]

Manifest:

<activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
        android:launchMode="singleTask"
        android:windowSoftInputMode="adjustResize"
        android:exported="true">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
      </activity>

config

const config = {
  clientId: '8FW1FdItN2EsPSugFHFACDwskxuKjpxS',
  domain: 'dev-6grfdf7yl20x0nrn.us.auth0.com',
};

Application Callback URLs Set On Dashboard:

com.auth0samples.auth0://dev-6grfdf7yl20x0nrn.us.auth0.com/android/com.auth0samples/callback, 
com.auth0samples.auth0://dev-6grfdf7yl20x0nrn.us.auth0.com/ios/com.auth0samples/callback

Thanks for the additional info.

In the build.gradle, can you try using dev-6grfdf7yl20x0nrn.us.auth0.com (remove the scheme).

It worked. Thank you so much!!!

Perfect! Thanks for the update.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.