最近几天我一直在研究 Azure AD B2C,得到了一个样本并让它运行起来。我面临的问题与AAD B2C 问题点 #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;
}
}
在“其他”部分,AuthenticationResponseChallenge 始终为空,这会引发错误。谁能给我一个详细的答复,是什么原因造成的以及如何解决?