Skip to content

Login / Logout / Refresh Endpoints

All auth endpoints are under /auth/. No authentication required unless noted.

POST /auth/login

Authenticate with email and password.

Request Body

json
{
  "email": "admin@example.com",
  "password": "secret",
  "provider": "default",
  "otp": "123456",
  "mode": "session"
}
FieldRequiredDescription
emailYesUser email address
passwordYesUser password
providerNoAuth provider name (default: "default")
otpNoTOTP code (required if TFA is enabled)
modeNoSet to "session" to receive refresh token as HttpOnly cookie

Response 200

json
{
  "data": {
    "access_token": "eyJhbGciOiJIUzI1NiJ9...",
    "expires": 900000,
    "refresh_token": "a1b2c3d4...",
    "post_login_action": "none",
    "password_expired_at": "2025-01-01T00:00:00.000Z"
  }
}
FieldDescription
access_tokenShort-lived JWT (default TTL: 15 minutes)
expiresAccess token TTL in milliseconds
refresh_tokenLong-lived token for refreshing (default TTL: 7 days). Absent when mode=session (sent as cookie instead)
post_login_actionPending action the client must resolve before the session is fully usable: none, or one of must_change_password / password_expired / tfa_setup_required (#44/#45/#46). Always present
password_expired_atOptional — the timestamp at which the current password expires, when a password-age policy is configured

Session Cookie Mode

When mode=session and SESSION_COOKIE_ENABLED=true, the refresh_token is set as an HttpOnly, Secure, SameSite=Lax cookie named odp_session_token. The response body still contains access_token and expires.

Errors

StatusCodeDescription
400INVALID_PAYLOADMissing email or password
401INVALID_CREDENTIALSWrong email or password (also returned for a wrong OTP code)
401OTP_REQUIREDAccount has TFA enabled (tfa_secret set) but no otp was supplied
403FORBIDDENEmail/password login is disabled — the local driver is used while an admin has turned off password login (#30)
403USER_SUSPENDEDAccount is suspended

Example

bash
curl -X POST http://localhost:6688/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email":"admin@example.com","password":"secret"}'

POST /auth/refresh

Exchange a refresh token for a new access token.

Request Body

json
{
  "refresh_token": "a1b2c3d4...",
  "mode": "session"
}
FieldRequiredDescription
refresh_tokenYes*Refresh token. Not needed when using cookie mode (read from cookie automatically)
modeNo"session" to set new refresh token as cookie

Response 200

json
{
  "data": {
    "access_token": "eyJhbGciOiJIUzI1NiJ9...",
    "expires": 900000,
    "refresh_token": "e5f6g7h8..."
  }
}

The old refresh token is invalidated. Each refresh issues a new refresh token (token rotation).

Errors

StatusCodeDescription
400INVALID_PAYLOADMissing refresh_token
401INVALID_TOKENToken expired or not found

POST /auth/logout

Invalidate a refresh token (and its associated session).

Request Body

json
{
  "refresh_token": "a1b2c3d4..."
}

When using cookie mode, the cookie is read automatically.

Response 204 (no body)

Also clears the session cookie if SESSION_COOKIE_ENABLED=true.


GET /auth/config

Public login configuration for the login screen (#30). Lets the client hide the password form and auto-redirect when exactly one SSO provider is configured.

Auth required: No (public)

Response 200

json
{
  "data": {
    "password_login_enabled": true,
    "sso_providers": []
  }
}
FieldDescription
password_login_enabledfalse when an admin has disabled email/password login
sso_providersPublic info for the configured SSO providers

POST /auth/password/request

Request a password reset email.

Request Body

json
{
  "email": "user@example.com",
  "reset_url": "https://app.example.com/reset"
}
FieldRequiredDescription
emailYesThe user's email address
reset_urlNoCustom reset URL for the email link

Response 204 — Always returns 204, even if email does not exist (prevents enumeration).


POST /auth/password/reset

Reset password using the token from the email.

Request Body

json
{
  "token": "reset-token-from-email",
  "password": "new-password"
}

Response 204


  • SSO & SAML Authentication — Full documentation of OAuth2, OpenID, and SAML SSO flows, provider configuration, and the verify/ACS endpoints.
  • Impersonation System — Start/stop impersonation sessions, access controls, JWT structure, and audit trail.
  • Sub-Tokens (API Keys) — Create scoped, long-lived API tokens with role restrictions and expiry.

ODP Internal API Documentation