Also available: Markdown version · llms.txt · full site content
Authentication
Authentication overview
CubiBase Auth runs on your project host under /auth/v1. Users live in your project’s database, and the access token they receive is the JWT your Data API calls use.
How it fits together
Your app
email + password
CubiBase Auth
Argon2id hash
Your database
example_project_db
- Users are rows in
auth.usersinside your project’s PostgreSQL database — not a shared directory. - Passwords are stored only as Argon2id hashes; refresh tokens are stored as hashes too.
- The
accessTokenis an HS256 JWT whosesubis the user id. Send it as the bearer token on Data API calls. - A table with a user column filters rows by that id automatically.
Sign-in methods
- Email and password Sign up, sign in, and the password rules.
- Anonymous users Let visitors in first; convert them in place later.
- Google sign-in OAuth redirect flow and ID-token flow, step by step.
- Multi-factor (TOTP) Authenticator apps, challenges, and required MFA.
Already have an identity provider? Configure the project to verify its RS256 tokens instead — see External identity providers.
The endpoints at a glance
| Endpoint | Purpose | Bearer token? |
|---|---|---|
POST /auth/v1/signup | Create a user, return a session | No |
POST /auth/v1/signup/anonymous | Create an anonymous session | No |
POST /auth/v1/token?grant_type=password | Sign in | No |
POST /auth/v1/token?grant_type=refresh_token | Refresh a session | No |
POST /auth/v1/token?grant_type=mfa | Complete an MFA challenge | No |
POST /auth/v1/token?grant_type=id_token | Verify a Google ID token | Optional (links) |
GET /auth/v1/authorize?provider=google | Start the Google flow | Optional (links) |
GET /auth/v1/callback | Google redirects back here | No |
POST /auth/v1/logout | Revoke a session | No |
GET /auth/v1/user | Read the signed-in user | Yes |
PATCH /auth/v1/user | Update the user; convert anonymous | Yes |
POST /auth/v1/factors | Enroll a TOTP factor | Yes |
POST /auth/v1/factors/verify | Confirm the first code | Yes |
DELETE /auth/v1/factors/{factorId} | Remove a factor | Yes |
Project settings
All of this is configured per project in Console → Auth: providers, password rules, token lifetimes, MFA, rate limits, the user directory, and sessions.
| Setting | Default |
|---|---|
| Signup enabled | On |
| Password sign-in enabled | On |
| Minimum password length | 8 characters |
| Email autoconfirm | On (no confirmation email is sent yet) |
| Access token lifetime | 1 hour |
| Refresh token lifetime | 30 days |
| Anonymous sign-ins | Off |
| Google sign-in | Off |
| MFA | Off (optional or required when on) |
| Signup rate limit | 30 per hour per IP |
| Sign-in rate limit | 30 per minute per IP |