Skip to content

feat(config): add auth.third_party.custom OIDC issuers (CLI-3359) - #7928

Open
7ttp wants to merge 4 commits into
developfrom
7ttp/cli-3359-config-add-a-custom-oidc-provider-to
Open

7ttp wants to merge 4 commits into
developfrom
7ttp/cli-3359-config-add-a-custom-oidc-provider-to

Conversation

@7ttp

@7ttp 7ttp commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

TL;DR

adds auth.third_party.custom.<name> so a local stack can verify tokens from OIDC issuers you configure, like Keycloak, Zitadel or Authentik

whats introduced?

each entry takes enabled and an absolute http or https issuer_url without a query or fragment, and its name uses lowercase letters, digits and underscores, starting with a letter, so it maps to SUPABASE_AUTH_THIRD_PARTY_CUSTOM_<NAME>_* overrides

any number of entries can run beside the one named provider allowed, and they stay local, so config push, config pull and config diff skip them

the local PostgREST, Storage, Realtime and Edge Functions trust every issuer's signing keys, an unreachable custom issuer stops startup naming it while functions serve skips it with a warning when it refreshes keys, and two issuers publishing different keys under one kid fail naming both

why?

a linked project can add any OIDC provider as third party auth, but the config only knew five named providers, so a custom issuer only printed an unknown key warning and its tokens got a 401 locally

Authentik documents its issuer with a trailing slash, so discovery now drops trailing slashes from every provider's issuer

ref

@7ttp 7ttp self-assigned this Dec 2, 2026
@7ttp
7ttp requested a review from a team as a code owner December 2, 2026 17:31
@7ttp
7ttp requested a review from kanadgupta December 2, 2026 17:31
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

CLI benchmark (Lightweight Commands): no changes found

Commit 62c6c80 against develop at 7e95031 · 10 runs each · report only, never blocks merging

Command Workload Before After Change
supabase --version version 242 ms 226 ms no real change (-6%, within normal variation)
supabase --help help 188 ms 178 ms no real change (-5%, within normal variation)
supabase init init 161 ms 171 ms no real change (+6%, within normal variation)
supabase migration new bench migration-new 279 ms 236 ms no real change (-16%, within normal variation)
supabase config convert config-convert 230 ms 237 ms no real change
supabase config validate config-validate 311 ms 296 ms no real change
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 364 ms 362 ms no real change
supabase projects list projects-list 285 ms 300 ms no real change
supabase functions list --project-ref replayfixtureprojref functions-list 261 ms 263 ms no real change

API calls: unchanged for all 9 commands.

Binary size: 135.1 MB, up 4.0 KB from 135.1 MB.

Details: timing ranges, API calls per command, slowest phases

Timing ranges

Command Workload Before range After range Change Verdict
supabase --version version 177-282 ms 190-281 ms -15 ms (-6%) within noise
supabase --help help 153-201 ms 147-217 ms -10 ms (-5%) within noise
supabase init init 143-186 ms 151-216 ms +10 ms (+6%) within noise
supabase migration new bench migration-new 168-384 ms 162-326 ms -44 ms (-16%) within noise
supabase config convert config-convert 153-365 ms 169-384 ms +7 ms (+3%) within noise
supabase config validate config-validate 235-482 ms 251-457 ms -15 ms (-5%) within noise
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 309-462 ms 234-475 ms -2 ms (-1%) within noise
supabase projects list projects-list 238-317 ms 260-406 ms +14 ms (+5%) within noise
supabase functions list --project-ref replayfixtureprojref functions-list 180-293 ms 192-424 ms +2 ms (+1%) within noise

API calls per command

Command Workload Before After Endpoint changes
supabase --version version 0 0
supabase --help help 0 0
supabase init init 0 0
supabase migration new bench migration-new 0 0
supabase config convert config-convert 0 0
supabase config validate config-validate 0 0
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 2 2
supabase projects list projects-list 1 1
supabase functions list --project-ref replayfixtureprojref functions-list 2 2

Slowest phases

No command moved beyond noise, so there are no phase deltas.

Workflow run

Comment /bench to run the lightweight benchmark (this comment) again on the latest commit, or /bench full to also run the integration-heavy benchmark, which posts in its own comment.

@7ttp

7ttp commented Dec 2, 2026

Copy link
Copy Markdown
Member Author

/ai-review

github-actions[bot]

This comment was marked as resolved.

@Coly010 Coly010 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks for picking this up, the gap in #7915 is real and following the workos path made this easy to follow

i'm requesting changes on two things, mostly because @supabase/config is published and the shape is hard to change once it ships:

  1. supporting more than one custom issuer (or at least picking a shape that lets us add that without a breaking change) - details inline on third_party.ts
  2. validating issuer_url as an actual URL in config validate - details inline on config-check-auth-units.ts

this also lands custom_oidc in the published ProjectConfig schema, so if we ever push third-party auth as a list we'd be stuck with this shape there too

fwiw i agree with rejecting the issuer-match finding from the AI review. Nothing downstream checks iss, so it wouldn't buy anything and it would break Authentik/Keycloak setups

the rest looks good to me, and if you disagree with the shape suggestion i'm open to talking it through

Comment thread apps/cli/src/shared/auth/jwks.ts Resolved
@7ttp 7ttp changed the title feat(config): add a custom OIDC third party auth provider (CLI-3359) feat(config): add named custom OIDC issuers (CLI-3359) Dec 3, 2026
@7ttp 7ttp changed the title feat(config): add named custom OIDC issuers (CLI-3359) feat(config): add auth.third_party.custom OIDC issuers (CLI-3359) Dec 3, 2026

@Coly010 Coly010 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks for turning this around so quickly! the keyed table is what i was hoping for, and the kid collision handling goes further than i asked

approving. There are two small things inline, neither blocking, so feel free to push back on either

Comment thread apps/cli/src/shared/auth/jwks.ts Resolved

This branch has not been deployed

No deployments
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.

config: add a custom OIDC provider to [auth.third_party], matching the hosted Third-Party Auth integration

2 participants