Azure AD B2C配置多个登录策略 [英] Azure AD B2C Configure Multiple Sign on Policies

查看:137
本文介绍了Azure AD B2C配置多个登录策略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Azure AD B2C中实现类似于

I would like to implement multiple sign up/sign in policies in Azure AD B2C similar to this question but I don't know how to configure my solution in Visual Studio to reference the different signup policies specified in the web.config file. Can anyone help please?

推荐答案

您可以通过

,然后在身份验证中间件中设置所请求策略的重定向URL :

OnRedirectToIdentityProvider = async context =>
{
    var policy = context.Properties.Items.ContainsKey(Constants.AuthenticationProperties.Policy) ? context.Properties.Items[Constants.AuthenticationProperties.Policy] : Constants.Policies.SignUpOrSignInWithPersonalAccount;
    var configuration = await GetB2COpenIdConnectConfigurationAsync(context, policy);
    context.ProtocolMessage.IssuerAddress = configuration.AuthorizationEndpoint;
}

这篇关于Azure AD B2C配置多个登录策略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆