react-native-auth0
react-native-auth0 copied to clipboard
Show duplicate app when with google account by auth0
Hi, I use react-native-auth0 version 2.13.3. When I log in with a google account, after I choose an account, have a popup showing 'open with ... ' with 2 applications but only the app can log in, remaining to fail.

Hi, can you run this command and see what are all the intent receivers you have for your package name - adb shell dumpsys package r. They can be in different locations so it would be great to comb through them or grep them
I can't run login google on adb and my stuck by a real device
https://github.com/auth0/react-native-auth0/pull/533#issuecomment-1281969768
@mailaneel Can you verify the above command doesn't generate 2 different intent receivers for your application id.
Can you also verify that the changes are the ones that are available in the app? Yarn has complicated cache management and wouldn't install the new package if the version number is same. I'd recommend to check if node_modules have the diff reflected
@poovamraj
- It does generate 2 intent receivers one for RedirectActivity and on for MainActivity
- Yes I have verified node_modules to see the changes are reflected from your commit
I see below
<activity
android:name="com.auth0.android.provider.RedirectActivity"
tools:node="remove"/>
<activity
android:name="com.auth0.android.provider.AuthenticationActivity"
tools:node="remove"/>
auth0 intent filter's looks like this
<activity
android:name="com.auth0.react.RedirectActivity"
android:exported="true">
<intent-filter android:autoVerify="true"
tools:targetApi="m">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="${auth0Domain}"
android:pathPrefix="/android/${applicationId}/callback"
android:scheme="${auth0Scheme}" />
</intent-filter>
</activity>
our one looks like this
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="${applicationId}"/>
</intent-filter>
Both are using same scheme and both matches one with prefix filter and one without prefix filter so seeing prompt
Before adding your PR change, I was seeing 3, one of them com.auth0.android.provider.RedirectActivity

Yep, that seems right, with the PR change there should only be 2. One is the launcher intent receiver and the other one is for our callback
So the issue is being reproduced in this scenario as well? That should be highly unlikely since we have only 1 intent receiver for URLs
yes its is reproducible unfortunately
Ah okay, I didn'tt realize you had a intent receiver as well. My bad. Great the issue is not occuring now.
sorry posted early, its still happening any help would be appreciated
Hi @mailaneel I'd suggest the following to avoid this issue. This is happening because your intent receiver is a catch-all and seems to interfere with the Authentication callback
- Use a different
schemefor authentication or your login. - Specify the exact
android:pathPrefixfor which you want to open your app. Now it will open for all links which has theschemethat is yourapplication_id
Hi @mailaneel @lehuydev2203 hope this answers your questions. I will close this issue for now, please feel free to reopen this if you have more doubts
Hey guys, can i use this thread because i have the exact similar problem. So in Callback URLS i do have just 1 for my application but then this modal Open with pop up and it has 2 times the application just like on the screenshot above. So from this suggestion https://github.com/auth0/react-native-auth0/issues/536#issuecomment-1282134579 1. is true but should i do 2. if i have unique scheme and still see open with twice with my app?
@poovamraj i have my callback url like this:
dev.environment.my.app://auth.opn.network/android/dev.environment.my.app/callback
and i have builded intent url like this using react native expo:
android: {
intentFilters: [
{
action: 'VIEW',
autoVerify: true,
data: [
{
scheme: 'dev.environment.my.app',
pathPrefix: '/android/dev.environment.my.app/callback',
},
],
category: ['BROWSABLE', 'DEFAULT'],
}
]
}
but still i see this pop up Open with and it has application 2 times
@AndonMitev did you try using the command mentioned here - https://github.com/auth0/react-native-auth0/issues/536#issuecomment-1280627909 to try and debug which activity is causing this?
Hey @poovamraj bro i have shared detailed info here: https://github.com/auth0/react-native-auth0/issues/554#issuecomment-1346664166