Skip to content

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](#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>
cemalkilic pushed a commit that referenced this pull request Aug 7, 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

* https://github.com/orgs/supabase/discussions/18909
cemalkilic pushed a commit that referenced this pull request Aug 7, 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](#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>
issuedat pushed a commit that referenced this pull request Sep 30, 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

* https://github.com/orgs/supabase/discussions/18909
issuedat pushed a commit that referenced this pull request Sep 30, 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](#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