Triggering email verification

一世执手 提交于 2019-12-11 02:41:42

问题


I am using custom policies.

The user journey desired is:

  1. User enters the email/password on screen 1.
  2. On successful validation of screen 1, the user is sent to screen 2. In screen 2 user has to enter a code sent to their email. (Note the user has already verified the email during sign up)

I am stuck at getting 2 to work. The current policy looks like this: Step 1 outputs email claim.

Step 2 takes the email claim as input.

In step 2 an editable text box with email prefilled is presented. No code is asked for. However, if the email is edited a code is asked for.

<TechnicalProfile Id="VerifyEmailAddress">
  <DisplayName>Local Account Signin</DisplayName>
  <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
  <Metadata>
    <Item Key="ContentDefinitionReferenceId">api.selfasserted</Item>
  </Metadata>
  <IncludeInSso>false</IncludeInSso>
  <InputClaims>
    <InputClaim ClaimTypeReferenceId="signInName" />
  </InputClaims>
  <OutputClaims>
    <OutputClaim ClaimTypeReferenceId="signInName" PartnerClaimType="Verified.Email" Required="true"/>
    <OutputClaim ClaimTypeReferenceId="objectId" />
    <OutputClaim ClaimTypeReferenceId="userPrincipalName" />
    <OutputClaim ClaimTypeReferenceId="authenticationSource" />
  </OutputClaims>
  <ValidationTechnicalProfiles>
    <ValidationTechnicalProfile ReferenceId="AAD-UserReadUsingEmailAddress" />
  </ValidationTechnicalProfiles>
</TechnicalProfile>   

回答1:


Yeah that caused me lots of trouble,

I basically use a claims transformation to do it

<InputClaimsTransformations>
   <InputClaimsTransformation ReferenceId="CopyClaimToreadOnly" />
</InputClaimsTransformations>
<InputClaims>
 <InputClaim ClaimTypeReferenceId="myAlreadyPopulatedClaim" />
 <InputClaim ClaimTypeReferenceId="myAlreadyPopulatedClaim-Readonly" />
</InputClaims>
<OutputClaims>
   <OutputClaim ClaimTypeReferenceId="myAlreadyPopulatedClaim-Readonly" 
PartnerClaimType="Verified.Email" />
 </OutputClaims>

The control isnt smart enough to realize that you populated the claim and you still want to do verification, it expects email entry and verification to be performed on the same page, when you split it you must do this claim copying

Hope this helps



来源:https://stackoverflow.com/questions/44351072/triggering-email-verification

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!