Skip to content

Add option to include the organization name in the organization claims - #51430

Open
netroutines wants to merge 1 commit into
keycloak:mainfrom
netroutines:50108-add-organization-name
Open

Add option to include the organization name in the organization claims#51430
netroutines wants to merge 1 commit into
keycloak:mainfrom
netroutines:50108-add-organization-name

Conversation

@netroutines

Copy link
Copy Markdown

Summary

Adds an optional Add organization name setting to the Organization Membership protocol mapper.

When enabled, the organization display name is included in the organization claim under the name property. 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' test

All 53 tests in OrganizationOIDCProtocolMapperTest passed.

Copilot AI balanced review requested due to automatic review settings August 4, 2026 18:07
@netroutines
netroutines requested review from a team as code owners August 4, 2026 18:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot AI review requested due to automatic review settings August 4, 2026 19:46
@netroutines
netroutines force-pushed the 50108-add-organization-name branch from 66959ac to c129fd4 Compare August 4, 2026 19:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.png is 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.

@netroutines netroutines changed the title Expose organization name in organization claims Add option to include the organization name in the organization claims Aug 5, 2026
Copilot AI review requested due to automatic review settings August 8, 2026 11:29
@netroutines
netroutines force-pushed the 50108-add-organization-name branch from c129fd4 to ae7a106 Compare August 8, 2026 11:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.png is 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>
Copilot AI review requested due to automatic review settings August 10, 2026 12:15
@netroutines
netroutines force-pushed the 50108-add-organization-name branch from ae7a106 to e10b0ba Compare August 10, 2026 12:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Organization Membership mapper should expose organization name

3 participants