具有自定义策略的 Azure AD B2C:无法使用临时密码对用户进行身份验证
Azure AD B2C with custom policies: Unable to authenticate user with temporary password
我已经使用自定义策略配置了 Azure AD B2C,但我无法使用在 Azure 门户中创建的新用户进行身份验证。用户有一个临时密码。 Azure AD B2C returns 错误文本 用户名或密码无效 ,即使用户名和密码正确。
我已确认可以使用非自定义策略在 Azure AD B2C 中使用新用户和临时密码登录。登录后,系统会提示用户更改密码。
可以使用本指南中描述的自定义策略重现该问题:
Get started with custom policies.
附加信息:
我已经在 UserJourneyRecorderEndpoint 中配置了 b2crecorder https://b2crecorder.azurewebsites.net/stream?id=<guid>
。通过 https://b2crecorder.azurewebsites.net/trace_102.html?id=<guid>
可以访问更多信息
问题导致以下日志记录:
SelfAssertedMessageValidationHandler
The message was received from null
Validation via SelfAssertedAttributeProvider
Additional validation is required...
OperativeTechnicalProfile is login-NonInteractive
Mapping 'username' partner claim type to 'signInName' policy claim type
Mapping default value 'undefined' to policy 'grant_type'
Mapping default value 'undefined' to policy 'scope'
Mapping default value 'undefined' to policy 'nca'
Mapping default value 'undefined' to policy 'client_id'
Mapping default value 'undefined' to policy 'resource_id'
Using validation endpoint at: https://login.microsoftonline.com/xxxx.onmicrosoft.com/oauth2/token
Orchestration Step: 1
RA: 0
Protocol selected by the caller: OAUTH2
Communications with the caller handled by: OAuth2ProtocolProvider
IC: True
OAuth2 Message: MSG(d56987e9-be2e-46fc-a7a4-23e317f8f174) Message Detail
ValidationRequest:
ValidationResponse:
Exception:
Exception of type 'Web.TPEngine.Providers.BadArgumentRetryNeededException' was thrown.
最常见的原因是尚未执行授予权限。
在 "ProxyIdentityExperienceFramework application" -> 选中 Access IdentityExperienceFramework 复选框后 -> 单击 Select 并点击完成,您还必须完成下一步:
Select 授予权限,然后通过选择 是.
进行确认
编辑:
抱歉,仔细阅读您的情况后,"sign-up or sign-in policy" 或 "custom policy" 都不支持 Azure Active Directory forceChangePasswordNextLogin
标志。 (forceChangePasswordNextLogin
仅适用于 "sign-up policy")有一个 feature request tracking this here.
由于这是关于这个问题的第一篇 SO 文章,我会补充说,当遇到这个问题时,另一种检查的可能性是,确保代理应用程序类型是本机,而不是 Web。
我已经使用自定义策略配置了 Azure AD B2C,但我无法使用在 Azure 门户中创建的新用户进行身份验证。用户有一个临时密码。 Azure AD B2C returns 错误文本 用户名或密码无效 ,即使用户名和密码正确。
我已确认可以使用非自定义策略在 Azure AD B2C 中使用新用户和临时密码登录。登录后,系统会提示用户更改密码。
可以使用本指南中描述的自定义策略重现该问题: Get started with custom policies.
附加信息:
我已经在 UserJourneyRecorderEndpoint 中配置了 b2crecorder https://b2crecorder.azurewebsites.net/stream?id=<guid>
。通过 https://b2crecorder.azurewebsites.net/trace_102.html?id=<guid>
问题导致以下日志记录:
SelfAssertedMessageValidationHandler
The message was received from null
Validation via SelfAssertedAttributeProvider
Additional validation is required...
OperativeTechnicalProfile is login-NonInteractive
Mapping 'username' partner claim type to 'signInName' policy claim type
Mapping default value 'undefined' to policy 'grant_type'
Mapping default value 'undefined' to policy 'scope'
Mapping default value 'undefined' to policy 'nca'
Mapping default value 'undefined' to policy 'client_id'
Mapping default value 'undefined' to policy 'resource_id'
Using validation endpoint at: https://login.microsoftonline.com/xxxx.onmicrosoft.com/oauth2/token
Orchestration Step: 1
RA: 0
Protocol selected by the caller: OAUTH2
Communications with the caller handled by: OAuth2ProtocolProvider
IC: True
OAuth2 Message: MSG(d56987e9-be2e-46fc-a7a4-23e317f8f174) Message Detail
ValidationRequest:
ValidationResponse:
Exception:
Exception of type 'Web.TPEngine.Providers.BadArgumentRetryNeededException' was thrown.
最常见的原因是尚未执行授予权限。
在 "ProxyIdentityExperienceFramework application" -> 选中 Access IdentityExperienceFramework 复选框后 -> 单击 Select 并点击完成,您还必须完成下一步:
Select 授予权限,然后通过选择 是.
进行确认编辑:
抱歉,仔细阅读您的情况后,"sign-up or sign-in policy" 或 "custom policy" 都不支持 Azure Active Directory forceChangePasswordNextLogin
标志。 (forceChangePasswordNextLogin
仅适用于 "sign-up policy")有一个 feature request tracking this here.
由于这是关于这个问题的第一篇 SO 文章,我会补充说,当遇到这个问题时,另一种检查的可能性是,确保代理应用程序类型是本机,而不是 Web。