@@ -18,8 +18,8 @@ Used in server-side configuration injection.
1818## TypeScript Usage
1919
2020``` typescript
21- import { AdvancedAuthConfig , AuthConfig , AuthPluginConfig , AuthProviderConfig , EmailAndPasswordConfig , EmailVerificationConfig , MutualTLSConfig , SocialProviderConfig } from ' @objectstack/spec/system' ;
22- import type { AdvancedAuthConfig , AuthConfig , AuthPluginConfig , AuthProviderConfig , EmailAndPasswordConfig , EmailVerificationConfig , MutualTLSConfig , SocialProviderConfig } from ' @objectstack/spec/system' ;
21+ import { AdvancedAuthConfig , AuthConfig , AuthPluginConfig , AuthProviderConfig , EmailAndPasswordConfig , EmailVerificationConfig , MutualTLSConfig , OidcProviderConfig , OidcProvidersConfig , SocialProviderConfig } from ' @objectstack/spec/system' ;
22+ import type { AdvancedAuthConfig , AuthConfig , AuthPluginConfig , AuthProviderConfig , EmailAndPasswordConfig , EmailVerificationConfig , MutualTLSConfig , OidcProviderConfig , OidcProvidersConfig , SocialProviderConfig } from ' @objectstack/spec/system' ;
2323
2424// Validate data
2525const result = AdvancedAuthConfig .parse (data );
@@ -57,6 +57,7 @@ Advanced / low-level Better-Auth options
5757| ** session** | ` Object ` | optional | |
5858| ** trustedOrigins** | ` string[] ` | optional | Trusted origins for CSRF protection. Supports wildcards (e.g. "https://* .example.com"). The baseUrl origin is always trusted implicitly. |
5959| ** socialProviders** | ` Record<string, Record<string, any>> ` | optional | Social/OAuth provider map forwarded to better-auth socialProviders. Keys are provider ids (google, github, apple, …). |
60+ | ** oidcProviders** | ` Object[] ` | optional | List of OIDC/OAuth2 providers for enterprise SSO. Can also be provided via OIDC_PROVIDERS env var as a JSON array. |
6061| ** emailAndPassword** | ` Object ` | optional | Email and password authentication options forwarded to better-auth |
6162| ** emailVerification** | ` Object ` | optional | Email verification options forwarded to better-auth |
6263| ** advanced** | ` Object ` | optional | Advanced / low-level Better-Auth options |
@@ -146,6 +147,32 @@ Email verification options forwarded to better-auth
146147| ** pinning** | ` Object ` | optional | Certificate pinning configuration |
147148
148149
150+ ---
151+
152+ ## OidcProviderConfig
153+
154+ OIDC / Generic OAuth2 provider configuration for enterprise SSO
155+
156+ ### Properties
157+
158+ | Property | Type | Required | Description |
159+ | :--- | :--- | :--- | :--- |
160+ | ** providerId** | ` string ` | ✅ | Unique identifier for this provider (e.g., okta, azure-ad) |
161+ | ** name** | ` string ` | optional | Display name shown in the UI (defaults to providerId) |
162+ | ** discoveryUrl** | ` string ` | optional | OIDC discovery URL (.well-known/openid-configuration). When provided, authorizationUrl/tokenUrl/userInfoUrl are fetched automatically. |
163+ | ** issuer** | ` string ` | optional | Expected issuer identifier for token validation |
164+ | ** authorizationUrl** | ` string ` | optional | OAuth2 authorization endpoint (optional if discoveryUrl is set) |
165+ | ** tokenUrl** | ` string ` | optional | OAuth2 token endpoint (optional if discoveryUrl is set) |
166+ | ** userInfoUrl** | ` string ` | optional | OAuth2 userinfo endpoint (optional if discoveryUrl is set) |
167+ | ** clientId** | ` string ` | ✅ | OAuth2 client ID |
168+ | ** clientSecret** | ` string ` | ✅ | OAuth2 client secret |
169+ | ** scopes** | ` string[] ` | optional | Requested scopes (default: openid email profile) |
170+ | ** pkce** | ` boolean ` | optional | Enable PKCE (recommended for public clients) |
171+
172+
173+ ---
174+
175+
149176---
150177
151178
0 commit comments