question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to call broker

See original GitHub issue

Describe 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:

  1. Open the app and tried to sign-in
  2. 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:closed
  • Created 2 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
ghtaylorcommented, Sep 28, 2021

Can you provide an update to this issue? We are facing this on some Android 11 devices.

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.

<manifest ...>
    ...
    <queries>
        <package android:name="com.azure.authenticator" />
        <package android:name="com.microsoft.windowsintune.companyportal" />
    </queries>
    ...
     <application ...>
    ...
</manifest>

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

1reaction
ghtaylorcommented, Jun 11, 2021

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to call broker - MSAL for Android - Stack Overflow
Problem App using latest MSAL for Android version is unable to call broker to sign-in. Followed the document to use MSAL for the...
Read more >
What Happens If I Can't Pay a Margin Call? - Investopedia
A failure to promptly meet these demands, known as a margin call, can result in the broker selling off the investor's positions without...
Read more >
When It's Time to Call Your Broker: 10 Issues You Should Ask ...
1. Contract issues · 2. Agency issues · 3. Client issues · 4. Earnest money issues · 5. Disclosure issues · 6. Cooperating...
Read more >
unable to connect to Broker - webMethods
It seem like the config/data files for the Broker got corrupted. Maybe apply the backup of these files can solve the problem.
Read more >
Can't make an outbound call from the CCP - Amazon Connect
The top reason most agents can't make outbound calls from the CCP is because their instance of Amazon Connect has not been set...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found