Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E-mail Output Claim with Local Account Username Signin #24

Closed
ltouro opened this issue Apr 2, 2018 · 4 comments
Closed

E-mail Output Claim with Local Account Username Signin #24

ltouro opened this issue Apr 2, 2018 · 4 comments

Comments

@ltouro
Copy link

ltouro commented Apr 2, 2018

I'm trying to ouput the E-mail claim when the user login with his Username but can't make it work.

I don't know which claim I should use. Tried these below separatelly with no success.

Any tips?
Thanks!!

<OutputClaim ClaimTypeReferenceId="email" />
<OutputClaim ClaimTypeReferenceId="email" PartnerClaimType="strongAuthenticationEmailAddress" />
<OutputClaim ClaimTypeReferenceId="signInNames.emailAddress" />
<OutputClaim ClaimTypeReferenceId="email" PartnerClaimType="Verified.Email" Required="true" />

part of TrustFrameworkBase.xml

  <TechnicalProfile Id="SelfAsserted-LocalAccountSignin-Username">
          <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="SignUpTarget">SignUpWithLogonUsernameExchange</Item>
              <Item Key="setting.operatingMode">Username</Item>
              <Item Key="ContentDefinitionReferenceId">api.selfasserted</Item>
          </Metadata>
          <IncludeInSso>false</IncludeInSso>
          <InputClaims>
              <InputClaim ClaimTypeReferenceId="signInName" />
          </InputClaims>
          <OutputClaims>
              <OutputClaim ClaimTypeReferenceId="signInName" Required="true" />
              <OutputClaim ClaimTypeReferenceId="password" Required="true" />
              <OutputClaim ClaimTypeReferenceId="objectId" />
              <OutputClaim ClaimTypeReferenceId="authenticationSource" />
              <OutputClaim ClaimTypeReferenceId="email" PartnerClaimType="strongAuthenticationEmailAddress" />
          </OutputClaims>

part of SignUpOrSignin.xml

<RelyingParty>
    <DefaultUserJourney ReferenceId="SignUpOrSignIn" />
    <UserJourneyBehaviors>
      <SingleSignOn Scope="Tenant" KeepAliveInDays="14" />
      <SessionExpiryType>Absolute</SessionExpiryType>
      <SessionExpiryInSeconds>1200</SessionExpiryInSeconds>
    </UserJourneyBehaviors>
    <TechnicalProfile Id="PolicyProfile">
      <DisplayName>PolicyProfile</DisplayName>
      <Protocol Name="OpenIdConnect" />
      <OutputClaims>
        <OutputClaim ClaimTypeReferenceId="signInName" PartnerClaimType="signInNames.userName" />
        <OutputClaim ClaimTypeReferenceId="email" PartnerClaimType="strongAuthenticationEmailAddress" />
        <OutputClaim ClaimTypeReferenceId="displayName" />
        <OutputClaim ClaimTypeReferenceId="objectId" PartnerClaimType="sub"/>
        <OutputClaim ClaimTypeReferenceId="userPrincipalName" />
        <OutputClaim ClaimTypeReferenceId="otherMails" />
      </OutputClaims>
      <SubjectNamingInfo ClaimType="sub" />
    </TechnicalProfile>
  </RelyingParty>
@ltouro
Copy link
Author

ltouro commented Apr 2, 2018

Also noted that is not possible to retrieve the E-mail address used during the SignUp through the A.D. Graph API. Is there any workaround for this?

The value is showed on the AD B2C dashboard of Azure Portal:

image

@chrispadgettlivecom
Copy link
Collaborator

Hi @ltouro

The SelfAsserted-LocalAccountSignin-Username technical profile can't output the email claim because the login-NonInteractive validation technical profile doesn't issue it.

Alternatively, you can add the email claim as an output claim from the AAD-UserReadUsingObjectId technical profile, so that it is read when the user object for the signed-in user is read.

@ltouro
Copy link
Author

ltouro commented Apr 19, 2018

@chrispadgettlivecom thanks for the feedback chris! Will try it

@ltouro
Copy link
Author

ltouro commented Apr 19, 2018

@chrispadgettlivecom I was able to ouput the email using InputClaimsTransformations as you described at this SO post.

By saving the E-mail on the otherEmails persisted claim, I'm able to retrieve it using the A.D. Graph API, which is very useful for my need.

Thank you very much for the multiple helps! 👍

@ltouro ltouro closed this as completed Apr 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants