Search code examples
azure-active-directorykeycloakazure-ad-b2ckeycloak-connect

KeyCloak Integration with Azure B2C UserName Mapping Issue


We’ve implemented a keycloak integration with Azure ADB2C as an identity provider. While mapping the user claims in keycloak from the b2c token, I’m seeing a blank for the ‘sub’ claim. Is there anything to modify in the B2C policy or the Keycloak mapping configuration settings?


Solution

  • I'm issue Sub on B2C custom policy at RelyingParty as < SubjectNamingInfo ClaimType="sub" / > that will map to the user ObjectID.

    RelayParty RelayParty

    TokenIssue TokenIssue

    Is that issue that you are facing? The value of the Sub is blank? Maybe you just need add it on the TP for token issue. A difference on Keycloak and B2C (that I found in a customer) is about the name pattern, that B2C use ID and KC use string as name.