AzureAD / microsoft-authentication-library-for-android

Microsoft Authentication Library (MSAL) for Android
http://aka.ms/aadv2
MIT License
217 stars 125 forks source link

Provided authority is not known. MSAL will only make requests to known authorities. #2202

Closed abhishekagra closed 1 week ago

abhishekagra commented 1 month ago

Describe the bug On MSAL Android library version above 5.0.1 (Android Gradle Plugin v8.0.0 and above), we are getting below error while calling acquireToken(): "Provided authority is not known. MSAL will only make requests to known authorities."

But on v5.0.1, authentication is working fine (Android Gradle Plugin v7.5.1).

{ "client_id": "xyz", "authorization_user_agent": "WEBVIEW", "redirect_uri": "", "account_mode": "MULTIPLE", "broker_redirect_uri_registered": false, "authorities": [ { "type": "B2C", "authority_url": "", "default": true } ] }

Smartphone (please complete the following information):

To Reproduce Update the MSAL library version from 5.0.1 to 5.1.0 (and above).

Are there any specific procedures or steps to follow to use the latest version of MSAL library v5.7.0 ?

negoe commented 3 weeks ago

Hi @abhishekagra Ensure that the authority_url specified in the JSON configuration is correct and follows the exact expected format for your B2C authority (e.g., https://.b2clogin.com/tfp//. You can follow the guidance here : https://learn.microsoft.com/en-us/entra/msal/dotnet/acquiring-tokens/desktop-mobile/social-identities#authority-for-an-azure-ad-b2c-tenant-and-policy