Email verification box disappears when passing email from Facebook as input claim to self-asserted profile

我只是一个虾纸丫 提交于 2020-05-16 03:12:53

问题


We want to force users to provide and verify their email address even when they reject passing their email claim from Facebook.

We created an orchestration step which calls the following technical profile after coming back from Facebook:

        <TechnicalProfile Id="SelfAsserted-ConfirmEmailSocial">
          <DisplayName>Confirm email social</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>
          <InputClaims>
            <InputClaim ClaimTypeReferenceId="email" />
          </InputClaims>
          <OutputClaims>
            <OutputClaim ClaimTypeReferenceId="email" PartnerClaimType="Verified.Email" Required="true" />
          </OutputClaims>
        </TechnicalProfile>

If the user rejects the facebook setting, the code works as expected: The verification control is shown. However, if the user accepts the facebook setting, both the input field and the verification control disappear. (And the email gets pre-populated)

(Someone explains here stack overflow that the control is too dumb to realize that you want to verify the input claim https://stackoverflow.com/a/44429492/509464) but we haven't been able to get the suggested solution to work.

How can we force validation of emails provided in a previous orchestration step?

Update: It seems we could create a workaround by making the input claim read-only somehow. (But only if it was empty).


回答1:


Yes the only option is making it read only, since otherwise we assume the passed in email is already verified, which it is with Facebook. If you change the email, then you must verify it. You could modify the JavaScript/css to show the controls. Or in the custom policy, use an input claim transform to copy the email claim into a new read-only claim id. Then pre-populate the form using input claim. Then display the claim using output claim.



来源:https://stackoverflow.com/questions/61661133/email-verification-box-disappears-when-passing-email-from-facebook-as-input-clai

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