p2-inc / keycloak-orgs

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

New token claim for a specific organization attribute #234

Closed prifulnath closed 3 weeks ago

prifulnath commented 1 month 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 1 month 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 1 month ago

@xgp Added test for the new claim mapper.

xgp commented 1 month 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.)?