Reputation: 21
As in the title, anybody knows how to get the object id of the user in oidc identity provider using keycloak?
I cannot figure out a way to add a custom mapper to get the user object id (as on the screenshot) when authenticating againt Azure Active Directory - when the Token (KeycloakAuthenticationToken) is populated to the Rest API, it does contain principal property from keycloak, not azure active directory.
Azure identifier:
I have sucessfully created a mapper for the groups - using this answer: https://stackoverflow.com/a/64411029/14320246
However there are available as additional attributes, as on screenshot Additonal attributes, but it is acceptable behaviour for also the oid param.
Upvotes: 2
Views: 1747
Reputation: 21
You should use 'oid' claim in your mapper. But you have to change default scope at Identity provider -> provider name -> Settings -> Default Scopes to "openid profile"
Upvotes: 2