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..."
  }
}
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)

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
401INVALID_OTPWrong OTP code
403USER_SUSPENDEDAccount is suspended

Example

bash
curl -X POST http://localhost:8055/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.


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