【发布时间】:2016-02-08 04:34:09
【问题描述】:
过去几天我一直在研究 Azure AD B2C,获得了一个示例并让它运行起来。 我面临的问题与AAD B2C issue 第 3 点完全一样,但我可以在这个问题中得到任何有价值的评论,这可能会解决我的问题。示例对我来说运行良好,但是当我在我的解决方案中实施它时,在提供 AAD B2C 凭据后,我最终得到:
private async Task OnRedirectToIdentityProvider(RedirectToIdentityProviderNotification<OpenIdConnectMessage, OpenIdConnectAuthenticationOptions> notification)
{
PolicyConfigurationManager mgr = notification.Options.ConfigurationManager as PolicyConfigurationManager;
if (notification.ProtocolMessage.RequestType == OpenIdConnectRequestType.LogoutRequest)
{
OpenIdConnectConfiguration config = await mgr.GetConfigurationByPolicyAsync(CancellationToken.None, notification.OwinContext.Authentication.AuthenticationResponseRevoke.Properties.Dictionary[Startup.PolicyKey]);
notification.ProtocolMessage.IssuerAddress = config.EndSessionEndpoint;
}
else
{
OpenIdConnectConfiguration config = await mgr.GetConfigurationByPolicyAsync(CancellationToken.None, notification.OwinContext.Authentication.AuthenticationResponseChallenge.Properties.Dictionary[Startup.PolicyKey]);
notification.ProtocolMessage.IssuerAddress = config.AuthorizationEndpoint;
}
}
在 'else' 部分,AuthenticationResponseChallenge 始终为 null,这会引发错误。谁能给我一个详细的答复,是什么原因造成的以及如何解决?
【问题讨论】:
-
我遇到了同样的问题...您找到解决方案了吗?下面的答案建议检查 PolicyConfigurationManager.cs 但它的哪一部分以及要寻找什么?我通过它,它似乎工作。示例表单 MS 也适用于我,但是当我的项目使用它时它不起作用
标签: azure-web-app-service azure-ad-b2c