Unable to call broker
See original GitHub issueDescribe the bug In development app using latest MSAL for Android version is unable to call broker to sign-in. Followed the doc to use MSAL for the app.
I have already check we are using the latest MSAL version, and the configuration JSON file, package name in their code are all set correctly including the "redirect URI, broker_redirect_uri_registered. Broker Microsoft Company Portal has already installed and and signed in. The device is compliant.
As I know, MSAL will call broker to sign-in by default. Any ideas why the app using MSAL is unable to call broker?
Smartphone (please complete the following information):
- Android Version: Android 11
- Browser: Default
- MSAL Version: 2.0.+
To Reproduce Steps to reproduce the behavior:
If related to user experience, use the format:
- Open the app and tried to sign-in
- The app will request the user to download broker even the user has downloaded on the app.
If related to development, please provide relevant configuration details necessary to understand your problem including any relevant traces, logs, or otherwise.
Expected behavior The app should call broker and sign in by default.
Actual Behavior The app will request the user to download broker(Microsoft Company portal)even the user has downloaded on the app.
Additional context Already checked the signature is correctly generated from the key.
Manifest: `<activity android:name="com.microsoft.identity.client.BrowserTabActivity"> <intent-filter> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!--
Add in your scheme/host from registered redirect URI
note that the leading "/" is required for android:path
-->
<data
android:host="com.imobilemind.isaicloud"
android:path="/hfy+7NbfbffwKZ9tqUkBtXgkJcE="
android:scheme="msauth" />
</intent-filter>`
Configuration file
{ "client_id" : "1540d24d-479b-4edb-9c98-971415582d29", "authorization_user_agent" : "DEFAULT", "redirect_uri" : "msauth://com.imobilemind.isaicloud/hfy%2B7NbfbffwKZ9tqUkBtXgkJcE%3D", "account_mode" : "SINGLE", "broker_redirect_uri_registered": true, "authorities" : [ { "type": "AAD", "default": true, "audience": { "type": "AzureADMyOrg", "tenant_id": "305675df-dc39-4b66-8034-b8e7a8cXXXXXX" } } ] }
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (1 by maintainers)
Top GitHub Comments
Hi Luke, I managed to fix this issue last week. I hope this helps you and others.
The issue affects both MSAL and ADAL and is related to changes to Package Visibility with Android 11. You must add the following code to your manifest file. I also found that I needed at least gradle plugin version 3.5.4; we were experiencing build errors with 3.5.3.
See the below links for extra information: https://stackoverflow.com/questions/62345805/namenotfoundexception-when-calling-getpackageinfo-on-android-11
https://developer.android.com/about/versions/11/privacy/package-visibility
I have filed an issue against the ADAL library but please check the details of it as if the issue seems identical it would suggest an issue with Company Portal rather than either of the authentication libraries
https://github.com/AzureAD/azure-activedirectory-library-for-android/issues/1612