Skip to content

Password Authentication

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.

POST https://auth.beshoy.ai/auth/login-form
Content-Type: application/x-www-form-urlencoded

Used by the server-rendered login page. Redirects on success/failure.

POST https://auth.beshoy.ai/auth/login
Content-Type: application/json

Used for programmatic authentication (e.g., testing, CLI tools).

FieldTypeRequiredDescription
emailstringYesUser’s email address
passwordstringYesUser’s password
project_idstringYesTarget project
redirect_uristringYesWhere to redirect after auth
code_challengestringYesPKCE S256 challenge
statestringYesOpaque state to return
  1. User submits email + password
  2. Auth service looks up user by email
  3. Verifies password via Argon2id
  4. Checks user exists in the target project (project_users)
  5. Checks user status is not “blocked”
  6. Generates authorization code, stores PKCE data in KV
  7. Redirects to redirect_uri with code and state
  • 5 attempts per 15 minutes per IP per project
  • Applies to both successful and failed attempts
  • Fails closed (KV unavailable → request denied)

For signup (not enforced on existing passwords):

  • Minimum 8 characters
  • At least one lowercase letter
  • At least one uppercase letter
  • At least one digit
  • Algorithm: Argon2id
  • Memory: 19,456 KiB (19 MiB)
  • Iterations: 2
  • Parallelism: 1
  • Library: hash-wasm (WebAssembly, runs on Workers)
ErrorCause
Invalid credentialsEmail not found or password mismatch
Account blockedUser status is “blocked” in this project
Not a memberUser exists but isn’t in this project
Rate limitedToo many attempts from this IP