Roles in ID token from Zitadel is removed

Open
#2,494 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
go

Research direction

Start by reproducing the issue with a Zitadel custom OIDC provider, using signInWithOAuth and auth.getSession to compare the ID token with the returned session. Trace how gotrue:v2.188.1 maps OIDC claims into session data; done means both Zitadel role keys remain available, with a regression test covering the behavior.

Written by the indexing model from the issue text.

Description

bug

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

Zitadel sends roles in ID token using keys urn:zitadel:iam:org:project:<projectid>:roles and urn:zitadel:iam:org:project:roles. However, these keys are not present in session object returned from supabase.auth.getSession.

To Reproduce

  1. Create Zitadel project.
  2. Enable Asset Roles on Authentication in project settings.
  3. Create application(WEB/CODE) under project.
  4. Enable User roles inside ID Token in token settings.
  5. Add Zitadel as custom OIDC provider.
  6. Authenticate using supabase.auth.signInWithOAuth and check session data using supabase.auth.getSession.

Expected behavior

Roles sent by Zitadel in ID token should be present in session data.

System information

  • Self hosted Supabase
  • supabase/gotrue:v2.188.1
Dominant language
Go
Stars
2.6k
Forks
764
Avg merge
5d 3h
Merged PRs (30d)
39

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from supabase/auth

All issues in supabase/auth

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.