Open opt05 opened 1 year ago
@opt05 Thanks for sharing the details of the issue. We will investigate and come back to you.
@opt05 Just to confirm, is the data part of both the apps's manifest is absolutely similat? And are you creating your "redirect_uri" using the same set of schemes information for both apps?
Tried reproducing this scenario on Android 11 and 13 and the app is throwing com.microsoft.identity.client.exception.MsalClientException: for me on Pixel device.
@negoe The way that we are reproducing and seeing it in our prod app is by installing the MyDish app (which is registering as some sort of catch all with MSAL scheme) and then using our own registration in our app's manifest (also mentioned above):
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application>
<activity
android:name="com.microsoft.identity.client.BrowserTabActivity"
android:exported="true">
<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:host="<insert your host>"
android:path="<insert your path>"
android:scheme="auth" />
</intent-filter>
</activity>
</application>
</manifest>
Then create the PublicClientApplication, like so: PublicClientApplication.createMultipleAccountPublicClientApplication(context, R.raw.msal_config)
Here is our R.raw.msal_config
, if that helps:
{
"client_id": "redacted",
"authorization_user_agent": "DEFAULT",
"redirect_uri": "auth://redacted/redacted",
"account_mode": "MULTIPLE",
"broker_redirect_uri_registered": true,
"shared_device_mode_supported": false,
"authorities": [
{
"type": "B2C",
"authority_url": "redacted",
"default": true
},
{
"type": "B2C",
"authority_url": "redacted"
}
]
}
I installed the MyDish app and our app on the following
com.microsoft.identity.client.exception.MsalClientException: More than one app is listening for the URL scheme defined for BrowserTabActivity in the AndroidManifest. The package name of this other app is: com.dish.mydish
Can you please advice how to recover from this situation (when user has another app with MSAL and matching "android:scheme="msauth"" attribute in manifest, installed from Google Play) ?
We encounter this problem from time to time and we discover more and more apps from Google Play that are colliding with our app. (createMultipleAccountPublicClientApplication
failing with "MsalClientException: More than one app is listening for the URL scheme defined for BrowserTabActivity in the AndroidManifest
") It's a bit ridiculous to ask user to uninstall other apps...
@negoe / @opt05 Please, your inputs would be very valuable
hi @Greta-Rad Thanks for the feedback. We are trying our best to carve out some space on our roadmap to address this issue. As soon as we have more clarity I will reach out to you.
The same on my side @negoe. I was trying to fight this problem for a few days already. I still get the error:
"More than one app is listening for the URL scheme defined for BrowserTabActivity in the AndroidManifest. The package name of this other app is: com.***.myapp.dev"
and the **com.***.myapp.dev** is exactly the ID of my app.
Samsung Galaxy S10 (fabric reset done) Android 12 CompileSDK 33.
Any news on that ?
Hi @negoe Any update on this issue. I have the same problem on my app if user install some bad app then they not able to login.
Describe the bug Related to #1722 then when an app has a matching scheme, on Android 11 and greater it no longer throws any exception and proceeds with the creation of the client application. This is probably due to Package Visibility change in Android 11
Smartphone (please complete the following information):
Stacktrace This is the expected stacktrace:
To Reproduce Steps to reproduce the behavior:
PublicClientApplication.createMultipleAccountPublicClientApplication(context, R.raw.msal_config)
Expected behavior Android 11+ should throw the same exception as Android 10 and below when
PublicClientApplication.createMultipleAccountPublicClientApplication
is calledActual Behavior On Android 11+, when any function(i.e.
acquireToken
) is called on thePublicClientApplication
, it will get stuck and never come back to the appScreenshots n/a
Additional context There probably needs to be added an intent query in the Manifest of the library