Add option to include the organization name in the organization claims - #51430
Add option to include the organization name in the organization claims#51430netroutines wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds optional organization display names to OIDC organization claims, addressing #50108.
Changes:
- Adds the disabled-by-default mapper option and forces JSON claims when enabled.
- Adds integration coverage for enabled, disabled, and claim-type behavior.
- Updates Admin Console text and documentation.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
core/src/main/java/org/keycloak/OAuth2Constants.java |
Defines the organization name claim key. |
services/src/main/java/org/keycloak/organization/protocol/mappers/oidc/OrganizationMembershipMapper.java |
Adds mapper configuration and name claim generation. |
tests/base/src/test/java/org/keycloak/tests/organization/mapper/OrganizationOIDCProtocolMapperTest.java |
Tests organization name mapping behavior. |
js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties |
Adds Admin Console labels and help text. |
docs/documentation/server_admin/topics/organizations/mapping-organization-claims.adoc |
Documents the optional name claim. |
66959ac to
c129fd4
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated no new comments.
Suppressed comments (1)
docs/documentation/server_admin/topics/organizations/mapping-organization-claims.adoc:29
- The PR summary says the Admin Console screenshot was updated, but the referenced
organizations-add-org-attrs-in-claim.pngis unchanged, so it cannot show the newly introduced Add organization name setting described here. Please regenerate and include that screenshot.
NOTE: By default, the organization id, name and attributes are not included in the organization claim. To include them, edit the mapper and enable the *Add organization id*, *Add organization name* and *Add organization attributes* options, respectively.
c129fd4 to
ae7a106
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated no new comments.
Suppressed comments (1)
docs/documentation/server_admin/topics/organizations/mapping-organization-claims.adoc:29
- The PR description says the Admin Console screenshot was updated, but the referenced
organizations-add-org-attrs-in-claim.pngis unchanged, so the documentation still uses the pre-feature image. Please update the screenshot to show the new setting or remove that claim from the PR description.
NOTE: By default, the organization id, name and attributes are not included in the organization claim. To include them, edit the mapper and enable the *Add organization id*, *Add organization name* and *Add organization attributes* options, respectively.
Add an optional mapper setting to include the organization name in organization membership claims. Closes keycloak#50108 Signed-off-by: Alexandru Andronic <220624545+netroutines@users.noreply.github.com>
ae7a106 to
e10b0ba
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated no new comments.
Suppressed comments (1)
docs/documentation/server_admin/topics/organizations/mapping-organization-claims.adoc:29
- The note documents the new Add organization name switch, but the screenshot referenced immediately below was not updated and therefore cannot show that switch, despite the PR description stating that the screenshot was updated. Please add a regenerated screenshot so the documented Admin Console view matches the new mapper options.
NOTE: By default, the organization id, name and attributes are not included in the organization claim. To include them, edit the mapper and enable the *Add organization id*, *Add organization name* and *Add organization attributes* options, respectively.
Summary
Adds an optional
Add organization namesetting to the Organization Membership protocol mapper.When enabled, the organization display name is included in the organization claim under the
nameproperty. The setting is disabled by default and forces the claim type to JSON when enabled.Documentation and the Admin Console screenshot were updated accordingly.
Closes #50108
Testing
./mvnw spotless:check./mvnw -f tests/base/pom.xml -DskipTests=false -Dtest='org.keycloak.tests.organization.mapper.OrganizationOIDCProtocolMapperTest#testIncludeOrganizationName' -Dsurefire.failIfNoSpecifiedTests=true test./mvnw -f tests/base/pom.xml -DskipTests=false -Dtest='org.keycloak.tests.organization.mapper.OrganizationOIDCProtocolMapperTest' testAll 53 tests in
OrganizationOIDCProtocolMapperTestpassed.