|
| 1 | +--- |
| 2 | +title: Authentication |
| 3 | +description: Configure sign-in, sessions, OAuth, OIDC/SSO, and device flow. |
| 4 | +--- |
| 5 | + |
| 6 | +# Authentication |
| 7 | + |
| 8 | +ObjectOS uses the ObjectStack authentication plugin, powered by |
| 9 | +Better Auth. Authentication is project-local: each project has its own |
| 10 | +identity tables and session scope. |
| 11 | + |
| 12 | +## What is supported |
| 13 | + |
| 14 | +Depending on the packaged application and enabled settings, ObjectOS can |
| 15 | +support: |
| 16 | + |
| 17 | +- email/password sign-in; |
| 18 | +- session management; |
| 19 | +- password reset and email verification; |
| 20 | +- social OAuth providers such as Google, GitHub, Microsoft, and Apple; |
| 21 | +- enterprise OIDC/SSO such as Okta, Entra ID, Keycloak, and Ping; |
| 22 | +- two-factor authentication; |
| 23 | +- passkeys/WebAuthn; |
| 24 | +- magic links; |
| 25 | +- CLI/browser device flow. |
| 26 | + |
| 27 | +## Required secret |
| 28 | + |
| 29 | +Set: |
| 30 | + |
| 31 | +```bash |
| 32 | +OS_AUTH_SECRET=replace-with-a-strong-random-secret |
| 33 | +``` |
| 34 | + |
| 35 | +ObjectOS derives a stable per-project secret from this value and the |
| 36 | +project environment id. This means: |
| 37 | + |
| 38 | +- sessions survive container restarts; |
| 39 | +- tokens from one project cannot be reused on another project; |
| 40 | +- rotating `OS_AUTH_SECRET` invalidates sessions. |
| 41 | + |
| 42 | +## Session isolation |
| 43 | + |
| 44 | +In multi-project deployments, cookies are scoped to the project hostname. |
| 45 | +ObjectOS intentionally avoids broad root-domain cookies for project |
| 46 | +sessions. This prevents a session from leaking across customer projects. |
| 47 | + |
| 48 | +## Social login |
| 49 | + |
| 50 | +Configure provider credentials through environment variables or system |
| 51 | +settings, depending on how the application package exposes auth |
| 52 | +configuration. |
| 53 | + |
| 54 | +Provider callback URLs use the ObjectOS auth route: |
| 55 | + |
| 56 | +```text |
| 57 | +https://<project-domain>/api/v1/auth/callback/<provider> |
| 58 | +``` |
| 59 | + |
| 60 | +Examples: |
| 61 | + |
| 62 | +```text |
| 63 | +https://crm.example.com/api/v1/auth/callback/google |
| 64 | +https://crm.example.com/api/v1/auth/callback/microsoft |
| 65 | +``` |
| 66 | + |
| 67 | +## Enterprise OIDC/SSO |
| 68 | + |
| 69 | +OIDC providers typically require: |
| 70 | + |
| 71 | +| Field | Description | |
| 72 | +|---|---| |
| 73 | +| Provider id | Stable id such as `okta` or `azure-ad` | |
| 74 | +| Display name | Button label shown to users | |
| 75 | +| Discovery URL | `.well-known/openid-configuration` endpoint | |
| 76 | +| Client id | Application client id from the identity provider | |
| 77 | +| Client secret | Secret stored in environment or encrypted settings | |
| 78 | +| Scopes | Usually `openid email profile` | |
| 79 | + |
| 80 | +For customer deployments, prefer OIDC discovery URLs over manually |
| 81 | +configured authorization/token/userinfo endpoints. |
| 82 | + |
| 83 | +## Platform SSO |
| 84 | + |
| 85 | +In cloud-connected deployments, ObjectOS can use the control-plane login |
| 86 | +as a platform SSO provider. A builder who is already signed in to the |
| 87 | +control plane can be provisioned into a project runtime without creating |
| 88 | +a separate project-local account. |
| 89 | + |
| 90 | +This requires the control plane and ObjectOS to share the same |
| 91 | +`OS_AUTH_SECRET` base secret. Disable platform SSO only when the customer |
| 92 | +wants every project to own a completely separate login boundary. |
| 93 | + |
| 94 | +## Operational checks |
| 95 | + |
| 96 | +Before production: |
| 97 | + |
| 98 | +- confirm expired tokens return `401`; |
| 99 | +- confirm logout revokes the active session; |
| 100 | +- confirm password reset revokes other sessions if required by policy; |
| 101 | +- confirm callback URLs match the public project domain; |
| 102 | +- confirm trusted origins include only approved domains; |
| 103 | +- confirm `OS_AUTH_SECRET` is stored in a secret manager, not in source. |
0 commit comments