简体   繁体   English

Blazor Webassembly asp.net 托管与 Microsoft Azure AD 身份验证

[英]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. https://docs.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/hosted-with-azure-active-directory?view=aspnetcore-6.0当我在本地调试时它工作正常.

Everything is fine, until I want to publish the application up to an Azure APP Service.一切都很好,直到我想将应用程序发布到 Azure APP 服务。

  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我在客户端注册中添加了APP服务https的URL://xxxxx.azurewebsites.net/authentication/login-callback
  3. In Visual Studio 2022 I publish the server application up to the App Service在 Visual Studio 2022 中,我将服务器应用程序发布到应用服务

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. AADSTS700054:没有为应用程序启用 response_type 'id_token'。

I can not find an example that go all the way to a published APP service...我找不到 go 一直到发布的 APP 服务的示例...

So what is wrong in my thinking here?那么我的想法有什么问题呢?

You need to register the app in Azure AD.您需要在 Azure AD 中注册应用程序。

Your error message is: "'id_token' is not enabled for the application"您的错误消息是:“没有为应用程序启用'id_token'”

To fix this under Advanced Settings, Implicit grant check the box "ID tokens".要在高级设置下解决此问题,请在隐式授权中选中“ID 令牌”框。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 部署托管到 Azure 的 Blazor WebAssembly 应用 ASP.NET Core - Deploy Blazor WebAssembly App ASP.NET Core hosted to Azure Blazor Webassembly (PWA) 是否支持独立的 session 存储(不在 asp.net 内核中托管)? - Is session storage supported in Blazor Webassembly (PWA) standalone (Not hosted in asp.net core)? Blazor WebAssembly 应用程序与个人帐户和 ASP.NET 核心托管 - 令牌请求 - “错误”:“unauthorized_client” - Blazor WebAssembly App with Individual Accounts and ASP.NET Core Hosted - Token request - "error": "unauthorized_client" Blazor Webassembly ASP.NET 核心托管无法通过 Facebook 授权 - Blazor Webassembly ASP.NET Core Hosted cannot authorize via Facebook Blazor WebAssembly 应用程序与个人帐户和 ASP.NET 核心托管 - 禁用用户注册 - Blazor WebAssembly App with Individual Accounts and ASP.NET Core Hosted - Disable user registration 如何将Asp.Net身份验证与Azure AD身份验证连接 - How to connect Asp.Net Identity authentication with Azure AD Authentication 在 ASP.NET Core 样板中集成 Azure AD 身份验证 - Integrating Azure AD authentication in ASP.NET Core boilerplate 通过Azure AD ADAL的ASP.NET MVC用户身份验证 - ASP.NET MVC User Authentication through Azure AD ADAL 使用Azure AD在ASP.NET Web应用程序中进行身份验证 - Authentication in an ASP.NET web application using Azure AD Asp.net Web窗体Web应用程序中的Azure AD身份验证 - Azure AD Authentication in Asp.net web forms web application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM