IDW10201: Neither scope or roles claim was found in the bearer token

后端 未结 4 695
醉话见心
醉话见心 2021-01-21 04:18

I have a ASP.NET Core 3.1 project like this sample: Sign-in a user with the Microsoft Identity Platform in a WPF Desktop application and call an ASP.NET Core Web API.

I\'

4条回答
  •  佛祖请我去吃肉
    2021-01-21 04:59

    This might help if you are planning on not using build in scopes or roles. You can enable "access-control list" authentication using my example for Azure B2C below. Here are some links to the official documentation.

    https://github.com/AzureAD/microsoft-identity-web/wiki/web-apis#user-content-web-apis-called-by-daemon-apps-using-client-credential-flow

    https://docs.microsoft.com/en-us/dotnet/api/microsoft.identity.web.microsoftidentityoptions.allowwebapitobeauthorizedbyacl?view=azure-dotnet-preview

    Add the following to your AD configuartion: "AllowWebApiToBeAuthorizedByACL": true

    Example:

    "AzureAdB2C": {
        "Instance": "https://xxx.b2clogin.com/",
        "ClientId": "xxxx",
        "Domain": "xxx.onmicrosoft.com",
        "SignUpSignInPolicyId": "xxx",
        "AllowWebApiToBeAuthorizedByACL": true
      },
    

    For what ACL/Access-control list means: ACL: https://en.wikipedia.org/wiki/Access-control_list

提交回复
热议问题