OAuth Authentication
The Shinzo Platform supports OAuth authentication via Google and GitHub. This allows users to sign in without creating a separate password.Google OAuth
Step 1: Get Authorization URL
| Field | Type | Required | Description |
|---|---|---|---|
returnTo | string | No | URL to redirect after successful authentication |
Step 2: Handle Callback
| Field | Type | Required | Description |
|---|---|---|---|
code | string | Yes | Authorization code from Google |
state | string | No | State parameter for CSRF protection |
GitHub OAuth
Step 1: Get Authorization URL
| Field | Type | Required | Description |
|---|---|---|---|
returnTo | string | No | URL to redirect after successful authentication |
Step 2: Handle Callback
| Field | Type | Required | Description |
|---|---|---|---|
code | string | Yes | Authorization code from GitHub |
state | string | No | State parameter for CSRF protection |
Response Fields
| Field | Type | Description |
|---|---|---|
token | string | JWT token for authenticated requests |
user | object | User profile information |
isNewUser | boolean | Whether this is a new account created via OAuth |
Status Codes
| Code | Description |
|---|---|
200 | Authentication successful |
400 | Invalid request (missing code, invalid state) |
401 | OAuth authentication failed |
Notes
- OAuth users don’t need to verify their email separately
- If a user with the same email already exists (registered via email/password), the accounts are linked
- The
isNewUserfield indicates whether a new account was created or an existing one was used

