p2-inc / keycloak-orgs

Single realm, multi-tenancy for SaaS apps
https://phasetwo.io
Other
417 stars 72 forks source link

New token claim for a specific organization attribute #234

Closed prifulnath closed 5 months ago

prifulnath commented 6 months ago

While doing some organization attribute mapping using "Organization Attribute" mapper. Some of the confidential organization attribute information was also added in the token. So, I added an organization specific single attribute selection mapper in this PR.

New mapper is "Organization Specific Attribute", which will add the attribute matching claim name, just as the user attribute.

Discussion about my issue, You can find little more info here.

xgp commented 6 months ago

@prifulnath Thanks for the PR. This will need a test before we can merge. See https://github.com/p2-inc/keycloak-orgs/blob/main/src/test/java/io/phasetwo/service/mapper/OrganizationRoleMapperTest.java for an example.

prifulnath commented 6 months ago

@xgp Added test for the new claim mapper.

xgp commented 6 months ago

@rtufisi Can also review this PR? Specifically see if the tests are thorough and test for edge cases (e.g. multiple attributes, multi-valued attributes, null value attributes, etc.)?