Unable to use bearer token to access AAD-secure Web API

前端 未结 2 1758
一整个雨季
一整个雨季 2021-01-14 15:35

I have an API app secured with Azure AD (AAD). I also have an AAD application for a consuming application, and in the consuming application I have set up permissions to acc

2条回答
  •  攒了一身酷
    2021-01-14 15:56

    Are you using "UseWindowsAzureActiveDirectoryBearerAuthentication"? In the Web API you should use it, add it in the Startup Config. As following:

    app.UseWindowsAzureActiveDirectoryBearerAuthentication( new WindowsAzureActiveDirectoryBearerAuthenticationOptions { Audience = ConfigurationManager.AppSettings["ida:Audience"], Tenant = ConfigurationManager.AppSettings["ida:Tenant"], });

    Hope this works for you, Regards!

提交回复
热议问题