asp.net - OpenIdConnect 错误 - 租户标识符可能不是空的 GUID

标签 asp.net azure owin azure-active-directory openid-connect

我正在尝试使用 OWIN Open ID Connect 中间件将我的 ASP.NET 应用程序的身份验证外包给 Azure Active Directory。应用程序在访问需要授权的页面时成功重定向到 Azure AD 登录页面。但是,在登录 Azure AD 时,我遇到以下错误:

AADSTS90002:请求的租户标识符“00000000-0000-0000-0000-000000000000”无效。租户标识符不能是空的 GUID。

这是给 UseOpenIdConnectAuthentication 的电话.包含在授权 URL 中的租户是 f82d0e29-6018-43c6-b806-1f46a009ff4a。那么为什么 Azure AD 认为我为租户传递了一个空的 GUID?

app.UseOpenIdConnectAuthentication(new OpenIdConnectAuthenticationOptions
            {
                AuthenticationType = "AzureAd",
                Caption = "Office 365",
                Scope = "openid email profile",
                ClientId = "e34401b2-6a9f-4547-9229-f0d93a33b1a1",
                Authority = "https://login.windows.net/f82d0e29-6018-43c6-b806-1f46a009ff4a/",
                PostLogoutRedirectUri = "http://localhost:44333",
                RedirectUri = "http://localhost:44333",
                AuthenticationMode = AuthenticationMode.Passive,
                SignInAsAuthenticationType = signInAsType
            });

最佳答案

现在 AAD 中可能存在错误。另一个线程也与这个线程同时启动:Empty GUID error when using Azure AD consent flow - 根据一项评论,AAD 团队已经意识到并正在调查此事。

更新:

有关完整的诊断和解决方案,请参阅我对这个问题的版本:

Azure Active Directory passing empty GUID for tenantId with default template

关于asp.net - OpenIdConnect 错误 - 租户标识符可能不是空的 GUID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43377553/

相关文章:

c# - 如何以货币格式显示数字

c# - 在 ASP.NET Azure 网站上使用 Ghostscript.Net

azure - 如何在 Azure Functions 中使用 OWIN?

javascript - ASP.Net 中的是/否消息框

asp.net - 为什么这个 JQuery 调用 asp.net pagemethod 会加载整个页面?

azure - kubectl : net/http: TLS handshake timeout

c# - Azure函数可选 "middle"路由参数

.NET STANDARD 4.7.2 Azure 不记名 token 授权

c# - 如何从 cookie 中检索 OpenID Connect 身份 token

asp.net - 如何处理ASP.NET的HyperLink.NavigateUrl中的特殊字符?