Password Authentication
Overview
Section titled “Overview”Password authentication is the standard email + password flow. Users submit credentials on the auth service’s login page, and on success receive an authorization code.
Endpoints
Section titled “Endpoints”Form Submission (Browser)
Section titled “Form Submission (Browser)”POST https://auth.beshoy.ai/auth/login-formContent-Type: application/x-www-form-urlencodedUsed by the server-rendered login page. Redirects on success/failure.
JSON API
Section titled “JSON API”POST https://auth.beshoy.ai/auth/loginContent-Type: application/jsonUsed for programmatic authentication (e.g., testing, CLI tools).
Request Fields
Section titled “Request Fields”| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | User’s email address |
password | string | Yes | User’s password |
project_id | string | Yes | Target project |
redirect_uri | string | Yes | Where to redirect after auth |
code_challenge | string | Yes | PKCE S256 challenge |
state | string | Yes | Opaque state to return |
- User submits email + password
- Auth service looks up user by email
- Verifies password via Argon2id
- Checks user exists in the target project (
project_users) - Checks user status is not “blocked”
- Generates authorization code, stores PKCE data in KV
- Redirects to
redirect_uriwithcodeandstate
Rate Limiting
Section titled “Rate Limiting”- 5 attempts per 15 minutes per IP per project
- Applies to both successful and failed attempts
- Fails closed (KV unavailable → request denied)
Password Requirements
Section titled “Password Requirements”For signup (not enforced on existing passwords):
- Minimum 8 characters
- At least one lowercase letter
- At least one uppercase letter
- At least one digit
Password Hashing
Section titled “Password Hashing”- Algorithm: Argon2id
- Memory: 19,456 KiB (19 MiB)
- Iterations: 2
- Parallelism: 1
- Library:
hash-wasm(WebAssembly, runs on Workers)
Error Responses
Section titled “Error Responses”| Error | Cause |
|---|---|
Invalid credentials | Email not found or password mismatch |
Account blocked | User status is “blocked” in this project |
Not a member | User exists but isn’t in this project |
Rate limited | Too many attempts from this IP |