Skip to content

feat(scim): store a per-provider SCIM token - #2670

Open
xlgmokha wants to merge 1 commit into
xlgmokha/auth-1362efrom
xlgmokha/auth-1368a
Open

feat(scim): store a per-provider SCIM token#2670
xlgmokha wants to merge 1 commit into
xlgmokha/auth-1362efrom
xlgmokha/auth-1368a

Conversation

@xlgmokha

@xlgmokha xlgmokha commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Feature. Adds sso_providers.scim_token_hash, a SHA-256 hex digest of the provider's SCIM token, with a partial unique index over the non-null values.

https://linear.app/supabase/issue/AUTH-1368/scim-users-get-by-id)

What is the current behavior?

The /scim/v2 router ships dark behind GOTRUE_EXPERIMENTAL_SCIM_ENABLED and serves the three discovery endpoints, but it has no authentication at all.

There is no way to associate a SCIM request with an SSO provider: sso_providers has no SCIM columns.

ServiceProviderConfig already advertises oauthbearertoken as its primary authentication scheme, with nothing behind it.

What is the new behavior?

sso_providers gains scim_token_hash, holding the SHA-256 hex digest of the provider's SCIM token, plus a partial unique index over the non-null values.
The plaintext token is never stored. Resolution is a single indexed equality on the digest of a secret, so there is no plaintext comparison and no timing-sensitive path.

Additional context

@xlgmokha xlgmokha self-assigned this Aug 3, 2026
@xlgmokha
xlgmokha marked this pull request as ready for review August 3, 2026 20:53
@xlgmokha
xlgmokha requested a review from a team as a code owner August 3, 2026 20:53
@xlgmokha
xlgmokha force-pushed the xlgmokha/auth-1368a branch from 5c30fe8 to 105842b Compare August 4, 2026 16:18
@xlgmokha
xlgmokha force-pushed the xlgmokha/auth-1368a branch from 105842b to 5c30fe8 Compare August 4, 2026 16:43
@xlgmokha
xlgmokha force-pushed the xlgmokha/auth-1368a branch from 5c30fe8 to 681e3de Compare August 4, 2026 16:46
Adds `sso_providers.scim_token_hash`, a SHA-256 hex digest of the
provider's SCIM token, with a partial unique index over the non-null
values. The plaintext is never stored, and resolution is a single
indexed equality on the digest rather than a comparison.
@xlgmokha
xlgmokha force-pushed the xlgmokha/auth-1368a branch from 681e3de to 8d5ab8e Compare August 4, 2026 17:19
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.

1 participant