Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(sso): use nullish coalescing and add env var for tokenEndpointAut…
…hentication

- Use ?? instead of || for semantic correctness
- Add SSO_OIDC_TOKEN_ENDPOINT_AUTH env var so users can explicitly
  set client_secret_basic when their provider requires it
  • Loading branch information
minijeong-log committed Mar 17, 2026
commit f365e1e62430988b5fa31efecdd7b306430f3530
6 changes: 5 additions & 1 deletion packages/db/scripts/register-sso-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ function buildSSOConfigFromEnv(): SSOProviderConfig | null {
pkce: process.env.SSO_OIDC_PKCE !== 'false',
authorizationEndpoint: process.env.SSO_OIDC_AUTHORIZATION_ENDPOINT,
tokenEndpoint: process.env.SSO_OIDC_TOKEN_ENDPOINT,
tokenEndpointAuthentication: process.env.SSO_OIDC_TOKEN_ENDPOINT_AUTH as
| 'client_secret_post'
| 'client_secret_basic'
| undefined,
Comment thread
cursor[bot] marked this conversation as resolved.
Outdated
userInfoEndpoint: process.env.SSO_OIDC_USERINFO_ENDPOINT,
jwksEndpoint: process.env.SSO_OIDC_JWKS_ENDPOINT,
discoveryEndpoint:
Expand Down Expand Up @@ -511,7 +515,7 @@ async function registerSSOProvider(): Promise<boolean> {
// credentials without URL-encoding per RFC 6749 §2.3.1, so '+' in secrets
// is decoded as space by OIDC providers, causing invalid_client errors.
tokenEndpointAuthentication:
ssoConfig.oidcConfig.tokenEndpointAuthentication || 'client_secret_post',
ssoConfig.oidcConfig.tokenEndpointAuthentication ?? 'client_secret_post',
jwksEndpoint: ssoConfig.oidcConfig.jwksEndpoint,
pkce: ssoConfig.oidcConfig.pkce,
discoveryEndpoint:
Expand Down