8000 feat: Add custom claims from Keycloak user token by wdoppenberg · Pull Request #1917 · supabase/auth · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: Add custom claims from Keycloak user token #1917

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 5, 2025

Conversation

wdoppenberg
Copy link
Contributor
@wdoppenberg wdoppenberg commented Jan 17, 2025

What kind of change does this PR introduce?

This change will populate the CustomClaims field from the Claims struct with 'other' claims from the Keycloak user token.

What is the current behavior?

Currently only Name, Sub, Email, and EmailVerified are taken from the Keycloak user token.

What is the new behavior?

The "custom_claims" field in the retrieved JWT is populated.

Additional context

@wdoppenberg wdoppenberg requested a review from a team as a code owner January 17, 2025 16:50
@coveralls
Copy link
coveralls commented Jan 23, 2025

Pull Request Test Coverage Report for Build 15463301096

Details

  • 25 of 27 (92.59%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.04%) to 70.255%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/api/provider/keycloak.go 25 27 92.59%
Totals Coverage Status
Change from base Build 15427124118: 0.04%
Covered Lines: 11337
Relevant Lines: 16137

💛 - Coveralls

Copy link
Contributor
@cstockton cstockton left a comment

Choose a reason for hiding this comment

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

Looks okay to me, lets wait for a +1 from @hf or @kangmingtay before merging. I'm not sure the affect this could have on JWT sizes.

@cstockton cstockton added enhancement New feature or request For discussion To discuss during next Auth catchup labels Jan 23, 2025
@wdoppenberg
Copy link
Contributor Author

Hi @hf @kangmingtay @cstockton is there anything I can look at to merge this feature?

@dhcsousa
Copy link
dhcsousa commented Feb 10, 2025

This would be useful for a use case that we have. Is there anything I can do to help?

@wdoppenberg
Copy link
Contributor Author

What is the timeline for merging this feature?

@ion-elgreco
Copy link

@cstockton can we merge this please?

@cstockton
Copy link
Contributor

@ion-elgreco @wdoppenberg @dhcsousa My apologies for the delay, I've seen no objections so I'll go ahead and merge this.

@cstockton cstockton merged commit 1365aaa into supabase:master Jun 5, 2025
6 checks passed
hf pushed a commit that referenced this pull request Jun 11, 2025
🤖 I have created a release *beep* *boop*
---


##
[2.176.0](v2.175.0...v2.176.0)
(2025-06-11)


### Features

* Add custom claims from Keycloak user token
([#1917](#1917))
([1365aaa](1365aaa))


### Bug Fixes

* accept ID tokens from all `account.apple.com` and `appleid.apple.com`
([#2050<
73B4
/a>](#2050))
([82aa167](82aa167))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request For discussion To discuss during next Auth catchup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0