简体   繁体   中英

Blazor Webassembly asp.net hosted with Microsoft Azure AD authentication

I found a lot number of examples how o do this. https://docs.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/hosted-with-azure-active-directory?view=aspnetcore-6.0 And it works fine when I run it locally in debug.

Everything is fine, until I want to publish the application up to an Azure APP Service.

  1. I create an App Service and connect the server registration to it
  2. I add on the client registration the URL of the APP Service https://xxxxx.azurewebsites.net/authentication/login-callback
  3. In Visual Studio 2022 I publish the server application up to the App Service

To my surprise, the application does not work from the published site...

I get the response:

Sign in
Sorry, but we're having trouble signing you in.

AADSTS700054: response_type 'id_token' is not enabled for the application.

I can not find an example that go all the way to a published APP service...

So what is wrong in my thinking here?

You need to register the app in Azure AD.

Your error message is: "'id_token' is not enabled for the application"

To fix this under Advanced Settings, Implicit grant check the box "ID tokens".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM