ada*_*dev 0 azure azure-active-directory azure-ad-b2c azure-ad-b2c-custom-policy
我目前正在为我的身份验证流程使用 Azure B2C 自定义策略。
我有一个 ClaimsProviderSelection 编排步骤,向用户显示两个选项:
我想做的是通过在显示文本或按钮本身中使用 ClaimProvider 来显示用户的电子邮件地址(见下文)
如果这是不可能的,那么我希望能够在验证控制页面本身上添加一个“丢失的电子邮件”按钮 - 如下所示:
但从我所看到的情况来看,这似乎仅适用于“ForgotPasswordExchange”(如下所示: https: //learn.microsoft.com/en-us/azure/active-directory-b2c/add-password-reset- policy?pivots=b2c-custom-policy)用于密码而不是身份验证方法。
如果任何人有任何自定义 ClaimsProviderSelection 步骤或在编排步骤上添加自定义链接的经验,我们将非常感谢您的帮助!
请参阅下面的代码示例:
编排步骤:
<OrchestrationStep Order="2" Type="ClaimsProviderSelection" ContentDefinitionReferenceId='api.MFAselections' >
<Preconditions>
<Precondition Type="ClaimsExist" ExecuteActionsIf="false">
<Value>strongAuthenticationEmailAddress</Value>
<Value>strongAuthenticationPhoneNumber</Value>
<Action>SkipThisOrchestrationStep</Action>
</Precondition>
</Preconditions>
<ClaimsProviderSelections>
<ClaimsProviderSelection TargetClaimsExchangeId="MFAVerifyEmailAddress" />
<ClaimsProviderSelection TargetClaimsExchangeId="LostEmailExchange" />
</ClaimsProviderSelections>
</OrchestrationStep>
Run Code Online (Sandbox Code Playgroud)
技术简介:
<TechnicalProfile Id="MFA_VerifyEmailAddress">
<DisplayName>SEND TO {Claim:strongAuthenticationEmailAddress}
</DisplayName>
<Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Metadata>
<Item Key="ContentDefinitionReferenceId">MFAVerifyEmail</Item>
<Item Key="IncludeClaimResolvingInClaimsHandling">true</Item>
<!-- <Item Key="setting.showContinueButton">false</Item> -->
<Item Key="setting.showCancelButton">false</Item>
<Item Key="UserMessageIfSessionDoesNotExist">You have exceeded the maximum time allowed.</Item>
<Item Key="UserMessageIfMaxRetryAttempted">You have exceeded the number of retries allowed.</Item>
<Item Key="UserMessageIfInvalidCode">You have entered the wrong code.</Item>
<Item Key="UserMessageIfSessionConflict">Cannot verify the code, please try again later.</Item>
</Metadata>
<InputClaims>
<InputClaim ClaimTypeReferenceId="MFAcomplete" DefaultValue="true" AlwaysUseDefaultValue='true'/>
</InputClaims>
<DisplayClaims>
<DisplayClaim DisplayControlReferenceId="emailVerificationControl" />
</DisplayClaims>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="MFAcomplete" DefaultValue="email" AlwaysUseDefaultValue='true' />
<OutputClaim ClaimTypeReferenceId="isLostEmail" DefaultValue="false" AlwaysUseDefaultValue='true' />
</OutputClaims>
<UseTechnicalProfileForSessionManagement ReferenceId="SM-AAD" />
</TechnicalProfile>
Run Code Online (Sandbox Code Playgroud)
对于遇到此问题的任何人 - 这就是我最终所做的:
<ContentDefinitionParameters> <Parameter Name="email">{Claim:maskedEmail}</Parameter> </ContentDefinitionParameters>
const parser = new URL(SETTINGS.remoteResource); let email = parser.searchParams.get('email');
| 归档时间: |
|
| 查看次数: |
1236 次 |
| 最近记录: |