Display the name of user in AD B2C instead of unknown

Admin 1 Reputation point

I am using custom policy to register the user and after successful registration, under the "All Users" tab I am not able to see the full name(firstName+lastName) of the user. Instead it keeps me showing "unknown". I tried Claim Transformations as per the documentation of the Microsoft Azure. Then also it shows me unknown. I am not sure in which policy I need to write ClaimTransformation code. Can anyone properly guide me with my issue?

Azure Active Directory External Identities
No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AmanpreetSingh-MSFT 55,431 Reputation points

    Hi @Admin • Thank you for reaching out.

    The reason for the displayName being set as Unknown, even after adding the Claims Transformation, is because Validation Technical Profile runs before OutputClaimTransformation. When signing up via email for the Local User account, LocalAccountSignUpWithLogonEmail technical profile is used. This technical profile includes AAD-UserWriteUsingLogonEmail technical profile as the validation technical profile. If you check AAD-UserWriteUsingLogonEmail technical profile, you can see <PersistedClaim ClaimTypeReferenceId="displayName" DefaultValue="unknown"/> . Since the validation technical profile runs before OutputClaimTransformation, you are getting the DefaultVaue of unknown.

    Please follow the below steps to get displayName by joining givenName + surname of the user.

    • Create below Claims Transformation:
       <ClaimsTransformation Id="CreateDisplayNameFromFirstNameAndLastName" TransformationMethod="FormatStringMultipleClaims">  
           <InputClaim ClaimTypeReferenceId="givenName" TransformationClaimType="inputClaim1" />  
           <InputClaim ClaimTypeReferenceId="surName" TransformationClaimType="inputClaim2" />  
           <InputParameter Id="stringFormat" DataType="string" Value="{0} {1}" />  
           <OutputClaim ClaimTypeReferenceId="displayName" TransformationClaimType="outputClaim" />  
    • Add below Technical Profile:
        <TechnicalProfile Id="Validate-DisplayName">  
             <DisplayName>Validate displayName</DisplayName>  
             <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.ClaimsTransformationProtocolProvider, Web.TPEngine, Version=, Culture=neutral, PublicKeyToken=null" />  
               <InputClaim ClaimTypeReferenceId="displayName" />  
               <OutputClaim ClaimTypeReferenceId="displayName" />  
               <OutputClaimsTransformation ReferenceId="CreateDisplayNameFromFirstNameAndLastName" />  
             <UseTechnicalProfileForSessionManagement ReferenceId="SM-Noop" />  
    • Add Validate-DisplayName technical profile as validation technical profile under LocalAccountSignUpWithLogonEmail technical profile as mentioned below (in same order):
          <ValidationTechnicalProfile ReferenceId="Validate-DisplayName" />  
          <ValidationTechnicalProfile ReferenceId="AAD-UserWriteUsingLogonEmail" />  


    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    1 person found this answer helpful.