Victor Moreira
Victor Moreira

Reputation: 89

Azure B2c custom attributes in custom policies do not come in the token

I created a custom policy in Azure B2c and used custom attributes.

However, custom attributes only enter the token when the user creates the account. When he logs in again, the custom attribute does not come in the token.

Below is my RelyingParty.

<RelyingParty>
    <DefaultUserJourney ReferenceId="SignUpOrSignIn" />
    <TechnicalProfile Id="PolicyProfile">
      <DisplayName>PolicyProfile</DisplayName>
      <Protocol Name="OpenIdConnect" />
      <OutputClaims>
        <OutputClaim ClaimTypeReferenceId="displayName" />
        <OutputClaim ClaimTypeReferenceId="givenName" />
        <OutputClaim ClaimTypeReferenceId="surname" />
        <OutputClaim ClaimTypeReferenceId="email" />
        <OutputClaim ClaimTypeReferenceId="objectId" PartnerClaimType="sub"/>
        <OutputClaim ClaimTypeReferenceId="identityProvider" />
        <OutputClaim ClaimTypeReferenceId="tenantId" AlwaysUseDefaultValue="true" DefaultValue="{Policy:TenantObjectId}" />
        <OutputClaim ClaimTypeReferenceId="extension_time" DefaultValue="" />
      </OutputClaims>
      <SubjectNamingInfo ClaimType="sub" />
    </TechnicalProfile>
  </RelyingParty>

Upvotes: 0

Views: 958

Answers (1)

Jas Suri - MSFT
Jas Suri - MSFT

Reputation: 11335

Add extension_time as an output claim into the AAD-UserReadUsingObjectId technical profile.

Upvotes: 1

Related Questions