Unable to get custom user properties (user_id) from Auth0 in Azure AD B2C claims

Gangarde, Sachin 85 Reputation points
2024-03-19T20:08:19.5466667+00:00

Hi,

We have added Auth0 as IDP in Azure AD B2C using custom policies like below:

<TechnicalProfile Id="Auth0-OID">
    <DisplayName>Auth0</DisplayName>
    <Protocol Name="OpenIdConnect" />
    <Metadata>
        <Item Key="METADATA">https://*******-dev.auth0.com/.well-known/openid-configuration</Item>
        <Item Key="authorization_endpoint">https://*********-dev.auth0.com/authorize</Item>
        <Item Key="response_types">code</Item>
        <Item Key="response_mode">form_post</Item>
        <Item Key="scope">openid email profile</Item>
        <Item Key="HttpBinding">POST</Item>
        <Item Key="UsePolicyInRedirecturi">0</Item>
        <Item Key="client_id">JRC************2I2PTt</Item>
    </Metadata>
    <CryptographicKeys>
        <Key Id="client_secret" StorageReferenceId="B2C_1A_Auth0DevTest1App" />
    </CryptographicKeys>
    <InputClaims>        
        <InputClaim ClaimTypeReferenceId="connection" />
    </InputClaims>
    <OutputClaims>
        <OutputClaim ClaimTypeReferenceId="objectId" PartnerClaimType="aud" />
        <OutputClaim ClaimTypeReferenceId="user_id" PartnerClaimType="user_id" />
        <OutputClaim ClaimTypeReferenceId="email" PartnerClaimType="email" />
        <OutputClaim ClaimTypeReferenceId="givenName" PartnerClaimType="given_name" />
        <OutputClaim ClaimTypeReferenceId="surname" PartnerClaimType="family_name" />
        <OutputClaim ClaimTypeReferenceId="displayName" PartnerClaimType="name" />
        <OutputClaim ClaimTypeReferenceId="identityProvider" DefaultValue="Auth0.com" AlwaysUseDefaultValue="true" />
        <OutputClaim ClaimTypeReferenceId="authenticationSource" DefaultValue="socialIdpAuthentication" />
        <OutputClaim ClaimTypeReferenceId="socialIdpUserId" PartnerClaimType="aud" />
        <OutputClaim ClaimTypeReferenceId="accountEnabled" DefaultValue="True" AlwaysUseDefaultValue="true"/>
    </OutputClaims>
    <OutputClaimsTransformations>
        <OutputClaimsTransformation ReferenceId="CreateRandomUPNUserName" />
        <OutputClaimsTransformation ReferenceId="CreateUserPrincipalName" />
        <OutputClaimsTransformation ReferenceId="CreateAlternativeSecurityId" />
        <OutputClaimsTransformation ReferenceId="CreateSubjectClaimFromAlternativeSecurityId" />
    </OutputClaimsTransformations>
    <UseTechnicalProfileForSessionManagement ReferenceId="SM-SocialLogin" />
</TechnicalProfile>

We are getting all the properties in the claims except user_id (which is Auth0 specific).

Auth0 user profiles looks like below and we want get "user_id" from user profile in the claims of Azure AD B2C.

enter image description here

We have added user_id defined as claimtype and also added in outputclaims in the user journey; but, all the time we are getting empty value for user_id claim.

What else needs to be done in order to get an IDP specific values in the claims?

Thank you.

Microsoft Security | Microsoft Entra | Microsoft Entra External ID
Microsoft Security | Microsoft Entra | Microsoft Entra ID
Microsoft Security | Microsoft Identity Manager
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.