Skip to content

Enable editing of custom claims for keycloak provider#16444

Merged
rak-phillip merged 1 commit intorancher:masterfrom
rak-phillip:task/16241-custom-claims
Jan 30, 2026
Merged

Enable editing of custom claims for keycloak provider#16444
rak-phillip merged 1 commit intorancher:masterfrom
rak-phillip:task/16241-custom-claims

Conversation

@rak-phillip
Copy link
Copy Markdown
Member

@rak-phillip rak-phillip commented Jan 22, 2026

Summary

This enables the editing of custom claims for keycloak provider.

Fixes #16241

Occurred changes and/or fixed issues

  • Enable editing of custom claims for keycloak provider
  • Add unit tests to assert new behavior

Technical notes summary

rancher/rancher#53465 contains fixes for custom userName claims in keycloak. This change requires that custom claims be enabled for keycloak as well as generic oidc.

Areas or cases that should be tested

Keycloak OIDC should render and save custom claims

Areas which could experience regressions

This change should be additive to the keycloak provider config form.

Screenshot/Video

image

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes
  • The PR has been reviewed in terms of Accessibility
  • The PR has considered, and if applicable tested with, the three Global Roles Admin, Standard User and User Base

Copy link
Copy Markdown
Member

@aalves08 aalves08 left a comment

Choose a reason for hiding this comment

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

Overall, the functionality and interaction with backend seems to work just fine. Data is being persisted on the backend and if we clear the checkbox on the UI, data is cleared on the backend as expected.

3 comments:

  • should we surface the claims info on the non-edit screen?
  • should we validate the email field (we probably have it somewhere in our code...)?
  • if we "add custom claims" (check the checkbox) are any of the fields required? right now the form reacts as none being required
Image

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
@rak-phillip rak-phillip force-pushed the task/16241-custom-claims branch from 84f1d38 to 8581806 Compare January 29, 2026 17:15
@rak-phillip
Copy link
Copy Markdown
Member Author

should we surface the claims info on the non-edit screen?

I don't think we should change this. The scope of the change is to surface existing behavior for keycloak.

should we validate the email field (we probably have it somewhere in our code...)?

If the ask is to treat this field as an email address, no. The custom claim would be something like user_email instead of email.

if we "add custom claims" (check the checkbox) are any of the fields required? right now the form reacts as none being required

I don't believe so. Custom claims are for manually mapping when a provider doesn't use standard claims in a token. There's no guarantee that we will need to map all three currently represented.

@rak-phillip rak-phillip requested a review from aalves08 January 29, 2026 17:30
Copy link
Copy Markdown
Member

@aalves08 aalves08 left a comment

Choose a reason for hiding this comment

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

Given the replies, 👍

@rak-phillip rak-phillip merged commit f07051e into rancher:master Jan 30, 2026
62 of 63 checks passed
@rak-phillip rak-phillip deleted the task/16241-custom-claims branch January 30, 2026 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keycloak custom mapping

2 participants