Skip to content

Commit d5831e7

Browse files
Copilothotlong
andcommitted
Refactor authentication architecture: separate Auth config from Identity models
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent bc3025e commit d5831e7

27 files changed

Lines changed: 1784 additions & 78 deletions
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: AuthProtocol
3+
description: AuthProtocol Schema Reference
4+
---
5+
6+
## Allowed Values
7+
8+
* `oidc`
9+
* `saml`
10+
* `ldap`
11+
* `oauth2`
12+
* `local`
13+
* `mock`
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
title: AuthProvider
3+
description: AuthProvider Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **name** | `string` || Provider ID |
11+
| **label** | `string` || Button Label (e.g. "Login with Okta") |
12+
| **type** | `Enum<'oidc' \| 'saml' \| 'ldap' \| 'oauth2' \| 'local' \| 'mock'>` || |
13+
| **config** | `object \| object \| object \| Record<string, any>` || Provider specific configuration |
14+
| **icon** | `string` | optional | Icon URL or helper class |
15+
| **active** | `boolean` | optional | |
16+
| **registrationEnabled** | `boolean` | optional | Allow new users to sign up via this provider |
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: Account
3+
description: Account Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **id** | `string` || Unique account identifier |
11+
| **userId** | `string` || Associated user ID |
12+
| **type** | `Enum<'oauth' \| 'oidc' \| 'email' \| 'credentials' \| 'saml' \| 'ldap'>` || Account type |
13+
| **provider** | `string` || Provider name |
14+
| **providerAccountId** | `string` || Provider account ID |
15+
| **refreshToken** | `string` | optional | OAuth refresh token |
16+
| **accessToken** | `string` | optional | OAuth access token |
17+
| **expiresAt** | `number` | optional | Token expiry timestamp (Unix) |
18+
| **tokenType** | `string` | optional | OAuth token type |
19+
| **scope** | `string` | optional | OAuth scope |
20+
| **idToken** | `string` | optional | OAuth ID token |
21+
| **sessionState** | `string` | optional | Session state |
22+
| **createdAt** | `string` || Account creation timestamp |
23+
| **updatedAt** | `string` || Last update timestamp |

content/docs/references/system/AuthConfig.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ description: AuthConfig Schema Reference
2222
| **csrf** | `object` | optional | |
2323
| **accountLinking** | `object` | optional | |
2424
| **twoFactor** | `object` | optional | |
25+
| **enterprise** | `object` | optional | |
2526
| **userFieldMapping** | `object` | optional | |
2627
| **database** | `object` | optional | |
2728
| **plugins** | `object[]` | optional | |
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
title: EnterpriseAuthConfig
3+
description: EnterpriseAuthConfig Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **oidc** | `object` | optional | OpenID Connect configuration |
11+
| **saml** | `object` | optional | SAML 2.0 configuration |
12+
| **ldap** | `object` | optional | LDAP/Active Directory configuration |
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: Session
3+
description: Session Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **id** | `string` || Unique session identifier |
11+
| **sessionToken** | `string` || Session token |
12+
| **userId** | `string` || Associated user ID |
13+
| **expires** | `string` || Session expiry timestamp |
14+
| **createdAt** | `string` || Session creation timestamp |
15+
| **updatedAt** | `string` || Last update timestamp |
16+
| **ipAddress** | `string` | optional | IP address |
17+
| **userAgent** | `string` | optional | User agent string |
18+
| **fingerprint** | `string` | optional | Device fingerprint |
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
title: User
3+
description: User Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **id** | `string` || Unique user identifier |
11+
| **email** | `string` || User email address |
12+
| **emailVerified** | `boolean` | optional | Whether email is verified |
13+
| **name** | `string` | optional | User display name |
14+
| **image** | `string` | optional | Profile image URL |
15+
| **createdAt** | `string` || Account creation timestamp |
16+
| **updatedAt** | `string` || Last update timestamp |
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: VerificationToken
3+
description: VerificationToken Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **identifier** | `string` || Token identifier (email or phone) |
11+
| **token** | `string` || Verification token |
12+
| **expires** | `string` || Token expiry timestamp |
13+
| **createdAt** | `string` || Token creation timestamp |

content/docs/references/system/identity/LDAPConfig.mdx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ description: LDAPConfig Schema Reference
77

88
| Property | Type | Required | Description |
99
| :--- | :--- | :--- | :--- |
10+
| **enabled** | `boolean` | optional | |
1011
| **url** | `string` || LDAP Server URL (ldap:// or ldaps://) |
11-
| **bindDn** | `string` || |
12-
| **bindCredentials** | `string` || |
13-
| **searchBase** | `string` || |
14-
| **searchFilter** | `string` || |
15-
| **groupSearchBase** | `string` | optional | |
12+
| **bindDn** | `string` || Bind DN for LDAP authentication |
13+
| **bindCredentials** | `string` || Bind credentials |
14+
| **searchBase** | `string` || Search base DN |
15+
| **searchFilter** | `string` || Search filter |
16+
| **groupSearchBase** | `string` | optional | Group search base DN |
17+
| **displayName** | `string` | optional | Display name for the provider button |
18+
| **icon** | `string` | optional | Icon URL or identifier |

content/docs/references/system/identity/OIDCConfig.mdx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ description: OIDCConfig Schema Reference
77

88
| Property | Type | Required | Description |
99
| :--- | :--- | :--- | :--- |
10+
| **enabled** | `boolean` | optional | |
1011
| **issuer** | `string` || OIDC Issuer URL (.well-known/openid-configuration) |
11-
| **clientId** | `string` || |
12-
| **clientSecret** | `string` || |
13-
| **scopes** | `string[]` | optional | |
12+
| **clientId** | `string` || OIDC client ID |
13+
| **clientSecret** | `string` || OIDC client secret |
14+
| **scopes** | `string[]` | optional | OIDC scopes |
1415
| **attributeMapping** | `Record<string, string>` | optional | Map IdP claims to User fields |
16+
| **displayName** | `string` | optional | Display name for the provider button |
17+
| **icon** | `string` | optional | Icon URL or identifier |

0 commit comments

Comments
 (0)