'Authentication failed: com.microsoft.identity.client.exception.MsalArgumentException: scopes cannot be null or empty
I don't understand why Scopes are required. Getting a token aways seems to require scopes. I get this error:
Authentication failed: com.microsoft.identity.client.exception.MsalArgumentException: scopes cannot be null or empty
when calling
IMultipleAccountPublicClientApplication.acquireToken
From a native android app.
In my Azure B2C Application settings, I have "Web App / Web API - Include web app / web API" set to "No". The information says: "Choose 'Yes' if this is a web application" and "Native client - Include native client" set to "Yes". The information about this says: "Choose 'Yes' if this is a native client. For example, a mobile or a desktop app".
I go to Published Scopes in Azure B2C for my Application and see: "Web app / Web API has not been included".
Since I cannot include Published Scopes as I was only trying to get this working on a Native Android Mobile App and I cannot call 'acquireToken' without scopes, I am not sure how to proceed.
Any background on scopes would be helpful as well. I am not really sure what 'Scopes' are. From what I have read they are fine grained permissions included in OAuth 2.0. I suppose it is up to the app, webapi, etc to actually implement them.
Solution 1:[1]
I have fixed this issue without adding a scope inside AzureAD Portal by using my client-id as Scope type:
public static List<String> getScopes() {
return Arrays.asList(
"your-client-id-here");
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Ro Ra |
