[keycloak-user] Don't see custom protocol mapper claim in identity.getAttributes()

Geoffrey Cleaves geoff at opticks.io
Sat Dec 1 18:25:07 EST 2018


Hi. I am using a client scope script mapper with:

token.setOtherClaims("cn", cn);

I expected to see this attribute in my Javascript Authorization Policy when
doing:

identity.getAttributes().toMap()

However, my "cn" claim/attribute is not there. Am I misunderstanding the
docs or doing something wrong? The docs say:

The Identity is built based on the OAuth2 Access Token that was sent along
with the authorization request, and this construct has access to all claims
extracted from the original token. For example, if you are using a *Protocol
Mapper* to include a custom claim in an OAuth2 Access Token you can also
access this claim from a policy and use it to build your conditions.



Regards,
Geoffrey Cleaves


More information about the keycloak-user mailing list