AADB2C90117: The scope 'User.Read' provided in the request is not supported.

Carol Lai 521 Reputation points
2021-06-02T17:01:37.237+00:00

I want to add authorization using groups & group claims to an ASP.NET Core Web app that signs-in users with the Microsoft identity platform on Azure AD B2C. So I downloaded the following example.
https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/master/5-WebApp-AuthZ/5-2-Groups

I modify the appsettings.json to the following to use my Azure AD B2C login instead of "https://login.microsoftonline.com/"
101707-image.png

I also followed the instruction at
https://learn.microsoft.com/en-us/azure/active-directory-b2c/microsoft-graph-get-started?tabs=app-reg-ga#grant-api-access
to grant API access to Microsoft Graph for the registered app.
101729-image.png

When I ran this app, it gave me AADB2C90117: The scope 'User.Read' provided in the request is not supported. How can I fix this problem?

Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
2,655 questions
{count} vote

2 answers

Sort by: Most helpful
  1. James Hamil 21,851 Reputation points Microsoft Employee
    2021-06-04T19:34:14.077+00:00

    Hi @Carol Lai , are you using B2C authority? Please reference this sample. You may need to add the b2c authority uri to the scope (instead of only user.read), like this:

    'https://graph.microsoft.com/v1.0/me', ["https://authorityuri/user.read"]  
    

    Please let me know if this works. If not I can help you further.

    If this answer helped you, please mark it as "Verified" so other users may reference it.

    Thank you,
    James Hamil

    2 people found this answer helpful.

  2. James Hamil 21,851 Reputation points Microsoft Employee
    2021-06-09T20:46:07.92+00:00

    Hi @Carol Lai ,

    Tokens that are issued by Azure AD B2C are intended for use by an Azure AD B2C-registered client with an Azure AD B2C-registered resource.

    Microsoft Graph API is not an Azure AD B2C-registered resource so the https://graph.microsoft.com/scopes aren't supported.

    Alternatively, you might consider passing the access token as the idp_access_token claim through, from the Microsoft identity provider to your Azure AD B2C-registered client.

    A custom policy is needed for the Microsoft identity provider to pass this through.

    I hope this helps. If so, please mark this answer as "Verified" so other users may reference it.

    Thank you,
    James

    0 comments No comments