简体   繁体   English

Blazor Webassembly Azure AD 身份验证托管在 Azure 存储帐户中

[英]Blazor Webassembly Azure AD authentication hosted in Azure storage account

According to instruction described in “Secure an ASP.NET Core Blazor WebAssembly standalone app with Azure Active Directory” https://docs.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/standalone-with-azure-active-directory?view=aspnetcore-3.1 I have created the simplest blazor webassembly app. According to instruction described in “Secure an ASP.NET Core Blazor WebAssembly standalone app with Azure Active Directory” https://docs.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/standalone-with-azure-active -directory?view=aspnetcore-3.1我创建了最简单的 blazor webassembly 应用程序。 At https://portal.azure.com I registered new app in AAD and based on generated GUIDs generated local app with this command:https://portal.azure.com我在 AAD 中注册了新应用程序,并根据生成的 GUID 使用以下命令生成本地应用程序:

dotnet new blazorwasm -au SingleOrg --client-id "{CLIENT ID}" --tenant-id "{TENANT ID}" -o {APP NAME} dotnet new blazorwasm -au SingleOrg --client-id "{CLIENT ID}" --tenant-id "{TENANT ID}" -o {APP NAME}

Everything worked fine if I launched app locally.如果我在本地启动应用程序,一切正常。 If I copied published app to storage account $web and try to log in I have received:如果我将已发布的应用程序复制到存储帐户 $web 并尝试登录,我会收到:

AADSTS50011: The reply URL specified in the request does not match the reply URLs configured for the application: '…'. AADSTS50011:请求中指定的回复 URL 与为应用程序配置的回复 URL 不匹配:“...”。

During app registration I have defined app as “Web” and put Redirect URL: https://localhost:5001/authentication/login-callback I have tried different combinations of URL changing hostname, deleting port and changing path. During app registration I have defined app as “Web” and put Redirect URL: https://localhost:5001/authentication/login-callback I have tried different combinations of URL changing hostname, deleting port and changing path. I don't know how to successfully configure app in AD.我不知道如何在 AD 中成功配置应用程序。

The AAD error states that the URL which you are getting redirected is not present in the reply url list configured in the app registration.You need to register a reply url in the format - {WebsiteUrl}/authentication/login-callback. The AAD error states that the URL which you are getting redirected is not present in the reply url list configured in the app registration.You need to register a reply url in the format - {WebsiteUrl}/authentication/login-callback.
Please give it a try then hopefully should resolve the issue.请试一试,希望能解决问题。
Note-WebsiteUrl is the Url hosted in azure注意-WebsiteUrl 是托管在 azure 中的 Url

Based on the answers and comments above, I took me 2 steps to solve this:根据上面的答案和评论,我采取了两个步骤来解决这个问题:

  1. Azure AD must have an entry in App registration | Azure AD 必须在App 注册中有条目 | Authentication |认证 | Single-page application |单页申请 | Redirect URIs that reads {WebsiteUrl}/authentication/login-callback .重定向读取{WebsiteUrl}/authentication/login-callback URI。 {WebsiteUrl} comes from the Storage account | {WebsiteUrl}来自存储帐户 | Static website | Static 网站 | Primary endpoint .主要终点

  2. Make sure that Storage account |确保存储帐户 | Static website | Static 网站 | Index document name and Error document path both point to index.html .索引文档名称错误文档路径指向index.html

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

相关问题 Blazor Webassembly asp.net 托管与 Microsoft Azure AD 身份验证 - Blazor Webassembly asp.net hosted with Microsoft Azure AD authentication Blazor Webassembly Azure AD 身份验证托管在 Azure 签名后返回 404 - Blazor Webassembly Azure AD authentication hosted in Azure return 404 after signing Blazor WebAssembly 和 Azure 函数身份验证 - Blazor WebAssembly and Azure Functions Authentication Azure 存储帐户身份验证 - Azure storage account authentication 部署托管到 Azure 的 Blazor WebAssembly 应用 ASP.NET Core - Deploy Blazor WebAssembly App ASP.NET Core hosted to Azure 使用身份验证托管的 Blazor Wasm 上的 Azure 500 错误 - Azure 500 error on a Blazor Wasm Hosted with Authentication Blazor webassembly pwa session 存储在部署到 Azure 后不持久 - Blazor webassembly pwa session storage not persisting after deployment to Azure Excel Power Query - 是否可以使用 SAS 身份验证或 Azure AD 帐户连接到 Azure Blob 存储 - Excel Power Query - Is it possible to connect to Azure Blob Storage with SAS authentication or Azure AD account 身份验证基于IIS托管的应用程序中的Azure AD - Authentication thought Azure AD in application hosted on IIS Azure 托管 Blazor WebAssembly 的替代方案 - Azure alternatives for hosting Blazor WebAssembly
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM