Share via

AD B2C Custom Policies auto-account-linking

Tiago C 0 Reputation points
Nov 8, 2024, 9:26 AM

I am currently trying to replicate the following custom policy sample:
https://github.com/azure-ad-b2c/samples/tree/master/policies/auto-account-linking

I generated all the needed things with the setup tool from the documentation, everything seems to have been generated correctly.
For some reason, when I am trying to login with, for example google, in order to see if the auto linking does in fact work I get the following error on App insights:

A Claim of ClaimType with id "userIdentity" was not found, which is required by the ClaimsTransformationImpl of Type "Microsoft.Cpim.Data.Transformations.AddItemToUserIdentityCollectionTransformation" for TransformationMethod "AddItemToUserIdentityCollection" referenced by the ClaimsTransformation with id "AppendUserIdentity" in policy "B2C_1A_AccountLink_Extensions" of tenant "tenant.onmicrosoft.com".

This is not making a lot of sense because as seen in the sample code provided, in the AccountLinkExtensions.xml, the "userIdentity" claimType is in fact declared.

Been stuck on this for a couple days, any clue why this may be happening ?User's image

Azure Policy
Azure Policy
An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
920 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,203 questions
{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.