Repository navigation
feat(config): add auth.third_party.custom OIDC issuers (CLI-3359) - #7928
Conversation
CLI benchmark (Lightweight Commands): no changes foundCommit
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 phasesTiming ranges
API calls per command
Slowest phasesNo command moved beyond noise, so there are no phase deltas. Comment |
|
/ai-review |
Coly010
left a comment
There was a problem hiding this comment.
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:
- 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 - validating
issuer_urlas an actual URL inconfig validate- details inline onconfig-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
auth.third_party.custom OIDC issuers (CLI-3359)
Coly010
left a comment
There was a problem hiding this comment.
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
TL;DR
adds
auth.third_party.custom.<name>so a local stack can verify tokens from OIDC issuers you configure, like Keycloak, Zitadel or Authentikwhats introduced?
each entry takes
enabledand an absolute http or httpsissuer_urlwithout credentials, a query or a fragment, and its name uses lowercase letters, digits and underscores, starting with a letter, so it maps toSUPABASE_AUTH_THIRD_PARTY_CUSTOM_<NAME>_*overridesany number of entries can run beside the one named provider allowed, and they stay local, so
config push,config pullandconfig diffskip themthe local PostgREST, Storage, Realtime and Edge Functions trust every issuer's signing keys, an unreachable custom issuer stops startup naming it while
functions serveskips it with a warning when it refreshes keys, and two issuers publishing different keys under onekidfail naming bothwhy?
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
[auth.third_party], matching the hosted Third-Party Auth integration #7915