Skip to content

Commit 43e2dcc

Browse files
committed
2 parents 3a03437 + 9cb0b8b commit 43e2dcc

5 files changed

Lines changed: 42 additions & 13 deletions

File tree

content/docs/guides/auth-sso.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The Studio login and registration pages automatically render **Continue with …
2727
For local development: `http://localhost:3000/api/v1/auth/callback/google`
2828
4. Copy the **Client ID** and **Client Secret**.
2929

30-
```env
30+
```bash
3131
GOOGLE_CLIENT_ID=your-google-client-id
3232
GOOGLE_CLIENT_SECRET=your-google-client-secret
3333

@@ -44,7 +44,7 @@ GOOGLE_CLIENT_SECRET=your-google-client-secret
4444
```
4545
3. Copy the **Client ID** and generate a **Client Secret**.
4646

47-
```env
47+
```bash
4848
GITHUB_CLIENT_ID=your-github-client-id
4949
GITHUB_CLIENT_SECRET=your-github-client-secret
5050
```
@@ -58,7 +58,7 @@ GITHUB_CLIENT_SECRET=your-github-client-secret
5858
```
5959
3. Under **Certificates & secrets**, create a new client secret.
6060

61-
```env
61+
```bash
6262
MICROSOFT_CLIENT_ID=your-azure-app-client-id
6363
MICROSOFT_CLIENT_SECRET=your-azure-client-secret
6464

@@ -75,7 +75,7 @@ MICROSOFT_CLIENT_SECRET=your-azure-client-secret
7575
```
7676
3. Generate a **private key** under **Keys**.
7777

78-
```env
78+
```bash
7979
APPLE_CLIENT_ID=your-apple-services-id
8080
APPLE_CLIENT_SECRET=your-apple-private-key-jwt
8181
```
@@ -90,7 +90,7 @@ For enterprise single sign-on, set the `OIDC_PROVIDERS` environment variable to
9090

9191
### Quick start — Okta
9292

93-
```env
93+
```bash
9494
OIDC_PROVIDERS='[
9595
{
9696
"providerId": "okta",
@@ -105,7 +105,7 @@ OIDC_PROVIDERS='[
105105

106106
### Quick start — Azure AD (OIDC)
107107

108-
```env
108+
```bash
109109
OIDC_PROVIDERS='[
110110
{
111111
"providerId": "azure-ad",
@@ -119,7 +119,7 @@ OIDC_PROVIDERS='[
119119

120120
### Quick start — Keycloak
121121

122-
```env
122+
```bash
123123
OIDC_PROVIDERS='[
124124
{
125125
"providerId": "keycloak",
@@ -134,7 +134,7 @@ OIDC_PROVIDERS='[
134134

135135
### Multiple enterprise providers
136136

137-
```env
137+
```bash
138138
OIDC_PROVIDERS='[
139139
{
140140
"providerId": "okta",

content/docs/references/api/auth-endpoints.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@ const result = AuthEndpoint.parse(data);
7171

7272
| Property | Type | Required | Description |
7373
| :--- | :--- | :--- | :--- |
74-
| **id** | `string` || Provider ID (e.g., google, github, microsoft) |
74+
| **id** | `string` || Provider ID (e.g., google, github, microsoft, okta) |
7575
| **name** | `string` || Display name (e.g., Google, GitHub) |
7676
| **enabled** | `boolean` || Whether this provider is enabled |
77+
| **type** | `Enum<'social' \| 'oidc'>` || Provider type |
7778

7879

7980
---

content/docs/references/cloud/project.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ Project type (prod/sandbox/dev/test/…)
210210
| **createdBy** | `string` || User ID that initiated the provisioning |
211211
| **metadata** | `Record<string, any>` | optional | Free-form metadata |
212212
| **hostname** | `string` | optional | Canonical hostname for this project (auto-generated if omitted) |
213+
| **templateId** | `string` | optional | Template to seed into the project on first provisioning (e.g. "crm", "todo"). Defaults to "blank". |
213214

214215

215216
---

content/docs/references/system/auth-config.mdx

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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
2525
const 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

packages/runtime/src/http-dispatcher.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1645,7 +1645,7 @@ export class HttpDispatcher {
16451645
if (adapter) {
16461646
const result = await adapter.createDatabase({
16471647
projectId,
1648-
databaseName: `proj-${projectId}`,
1648+
databaseName: `p-${projectId.replace(/-/g, "").slice(0, 24)}`,
16491649
region: 'us-east-1',
16501650
storageLimitMb: req.storage_limit_mb ?? 1024,
16511651
});
@@ -1908,7 +1908,7 @@ export class HttpDispatcher {
19081908
if (adapter) {
19091909
const result = await adapter.createDatabase({
19101910
projectId: id,
1911-
databaseName: `proj-${id}`,
1911+
databaseName: `p-${id.replace(/-/g, "").slice(0, 24)}`,
19121912
region: 'us-east-1',
19131913
storageLimitMb: envRow.storage_limit_mb ?? 1024,
19141914
});

0 commit comments

Comments
 (0)