p2-inc / keycloak-orgs

Single realm, multi-tenancy for SaaS apps
Other
362 stars 65 forks source link

Organization mapper: displayName support #117

Closed mweibel closed 10 months ago

mweibel commented 10 months ago

I was wondering if we could find a way to expose the displayName in the mappers, additionally to the name. I know I could just send a PR to add it but I was wondering whether there's a way to make it a flag so people can decide what to expose? Otherwise I guess it would make sense to make a separate mapper which exposes the displayName instead of the name?

xgp commented 10 months ago

Sure @mweibel . The mappers can have configuration exposed with ProviderConfigProperty. You could add a bool config option for including the display name, and then update the getOrganizationClaim method to optionally include it in the claim.

Alternately, we created a /me endpoint a while back as an alternative to using claim mappers. The idea is similar to the OIDC /userinfo endpoint, but to give you an easy way to get all of the information about the logged-in user's organizations:

xgp commented 10 months ago

@mweibel If you choose to update or do a new mapper, I'll keep this issue open to track. Otherwise, please close.

mweibel commented 10 months ago

thank you for the information! I'll have a look a bit later - the /me endpoint sounds interesting too but I couldn yet try it.

mweibel commented 10 months ago

actually, I just tested it quickly and /me is fine 👍 thanks!