【发布时间】:2018-01-12 03:44:44
【问题描述】:
我的 webapp 使用 B2C 进行身份验证。当我使用默认域 (tenant.onmicrosoft.com) 或简单的自定义域 (sampledomain.com) 注册我的应用程序时,一切正常。
我想使用一个子域进行身份验证 (login.sampledomain.com) 并为我的每个合作伙伴组织使用一个单独的子域 (partner1.sampledomain.com, partner2.sampledomain.com),我已按照说明进行操作 https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-app-registration#limitations 没有成功。
当我执行身份验证挑战时
var redirectUrl = "https://login.sampledomain.com/auth-callback";
HttpContext.GetOwinContext().Authentication.Challenge(
new AuthenticationProperties { RedirectUri = redirectUrl })
错误消息显示我的子域的 错误 值:
"AADB2C90006:重定向 URI 请求中提供的https://login.sampledomain.onmicrosoft.com/ 是 未为客户注册"
因此,我配置的子域“login.sampledomain.com”在 B2C 中显示为不正确的值“login.sampledomain.onmicrosoft.com”。。 p>
我可以提供一些其他属性或配置设置,以便 B2C 不会操纵我的子域。
是否有其他人使用 B2C 自定义子域,这可能吗?
【问题讨论】:
-
AuthenticationProperties.RedirectUri属性是指在 B2C 令牌已被身份验证中间件验证后重定向到的返回 URL。您在启动类中将OpenIdConnectAuthenticationOptions.CallbackPath属性设置为什么?这是在 B2C 身份验证请求中作为redirect_uri参数发送的内容。 -
怎么按照文档添加回复地址却失败了?有任何错误信息吗?您必须在回复 URL 中添加
https://sampledomain.com、https://partner1.sampledomain.com、https://partner2.sampledomain.com。注意:您不能在回复 URL 中添加不同的域。
标签: azure azure-active-directory azure-ad-b2c