Blazor webassembly azure ad authentication issue after migration to .net5

Viewed 225

Blazor webassembly azure ad authentication issue after migration to .net5

Error: AADSTS28000: Provided value for the input parameter scope is not valid because it contains more than one resource. Scope https://graph.microsoft.com/User.Read api://861be009-5e73-4c6c-a095-b6e193522222/API. Access openid profile is not valid.

Scope Code(web assembly):

    builder.Configuration.Bind("AzureAd", options.ProviderOptions.Authentication);
    options.ProviderOptions.DefaultAccessTokenScopes.Add("https://graph.microsoft.com/User.Read");
    options.ProviderOptions.DefaultAccessTokenScopes.Add("api://861be009-5e73-4c6c-a095-b6e193522222/API.Access");
1 Answers

When you request the token, you are using different resource endpoints in the scope, i.e. Microsoft Graph and your custom API in your case, it is not correct, you can just request the token for one resource, because one token can just have one audience.

Related