Search code examples
azure-ad-b2cazure-ad-b2c-custom-policymicrosoft-entra-idazure-entra-id

Assign B2C User to ExternalAzureAD identity


Is it possible in Azure AD B2C that I can assign a special identity (e.g. ExternalAzureAD) to a user when a user logs in? Currently all users are stored with their email as identity.

I tried searching the internet but i did't read the answer yet.


Solution

  • Thanks to @rbrayb I got the right sample for my needs from github here.

    I just needed to add:

    <TechnicalProfile Id="AAD-UserWriteUsingXY">
      ...
      <PersistedClaims>
        ...
        <!-- Added these lines -->
        <PersistedClaim ClaimTypeReferenceId="alternativeSecurityId" />
        <PersistedClaim ClaimTypeReferenceId="userPrincipalName" />
        ...
      </PersistedClaims>
      ...
    </TechnicalProfile>
    

    to my custom Technical Profile which is writing my user to Azure AD B2C.

    After that my EntraId-Provider is linked with my B2C local account.