|
1 | | -# Authentication Protocol |
| 1 | +# ObjectStack Authentication Standard |
2 | 2 |
|
3 | | -A comprehensive authentication specification for the ObjectStack ecosystem. |
| 3 | +The standard authentication protocol specification for the ObjectStack ecosystem. |
4 | 4 |
|
5 | 5 | ## Overview |
6 | 6 |
|
7 | | -This specification defines the standard authentication protocol for ObjectStack applications. It supports multiple authentication strategies, session management, and comprehensive security features. |
| 7 | +This document defines the **ObjectStack Authentication Standard**, a comprehensive, framework-agnostic authentication protocol for ObjectStack applications. This standard supports multiple authentication strategies, session management, and comprehensive security features. |
8 | 8 |
|
9 | | -The specification is framework-agnostic and can be implemented with any authentication library (better-auth, Auth.js, Passport, etc.) |
| 9 | +The specification is designed as an **interface** that can be implemented by any authentication library. **better-auth** serves as the **Reference Implementation** (default driver) for this standard. |
| 10 | + |
| 11 | +### Implementation Drivers |
| 12 | + |
| 13 | +The authentication standard can be implemented using various drivers: |
| 14 | +- **better-auth** (default/reference implementation) |
| 15 | +- Auth.js |
| 16 | +- Passport |
| 17 | +- Custom implementations |
10 | 18 |
|
11 | 19 | ## Features |
12 | 20 |
|
@@ -54,11 +62,12 @@ pnpm add @objectstack/plugin-better-auth |
54 | 62 | ### Basic Example |
55 | 63 |
|
56 | 64 | ```typescript |
57 | | -import type { AuthenticationConfig } from '@objectstack/spec'; |
| 65 | +import type { AuthConfig } from '@objectstack/spec'; |
58 | 66 |
|
59 | | -const authConfig: AuthenticationConfig = { |
| 67 | +const authConfig: AuthConfig = { |
60 | 68 | name: 'main_auth', |
61 | 69 | label: 'Main Authentication', |
| 70 | + driver: 'better-auth', // Optional, defaults to 'better-auth' |
62 | 71 | strategies: ['email_password'], |
63 | 72 | baseUrl: 'https://app.example.com', |
64 | 73 | secret: process.env.AUTH_SECRET!, |
|
0 commit comments