[keycloak-user] Tooltip IdP mapper "Username Template Importer" as example "${ALIAS}.${CLAIM.sub}" but it does not work

Jean-François HEROUARD jfherouard.almerys at gmail.com
Thu Mar 21 11:40:29 EDT 2019


Hi,

When configuring an "Username Template Importer" as a mapper of an identity
provider, the tooltip says that it could be "${ALIAS}.${CLAIM.sub}" but
"sub" is not an accessible claim.

AbstractClaimMapper.getClaimValue() only looks into token.getOtherClaims(),
so only claims binded by @JsonAnySetter are accessible, not sub iss jti...

I patch it :
        Map<String, Object> jsonObject = token.getOtherClaims();
        jsonObject.put("jti", token.getId());
        jsonObject.put("sub", token.getSubject());
        jsonObject.put("iss", token.getIssuer());
        jsonObject.put("azp", token.getIssuedFor());
Because I need to be able to get these attributes.

Either the tooltip or the code has a bug ?


More information about the keycloak-user mailing list