Pinter
ENID
Authentication
View as Markdown

Authenticate User & Issue JWT Access Token

POST/api/identity/token

Overview

Authenticates a user using credentials (username/email and password).

Authentication & Headers

  • Auth: Public (OAuth2 Password Flow)
  • Required Header: API-Version: 1
  • Optional Header: X-Device-ID: <device-uuid> for client binding and anomaly tracking

Parameters & Request Body

  • username (string, required): The registered account email or username.
  • password (string, required): The account plaintext password.

Behavior & MFA Flow

  1. Standard Flow: If MFA is disabled for the account, returns 200 OK with access_token (JWT) and refresh_token.
  2. MFA Flow: If Multi-Factor Authentication is enabled, returns 401 Unauthorized with {"detail": {"mfa": true, "mfa_token": "...", "mfa_methods": [...]}}. Proceed to /api/identity/mfa/send and /api/identity/mfa/verify.

Parameters

Header

X-Device-IDstring
Unique client hardware or browser fingerprint UUID for device binding and audit security.

Request body

application/x-www-form-urlencoded

grant_typestring | null
usernamestringrequired
passwordstring (password)required
scopestring
client_idstring | null
client_secretstring | null
{
  "grant_type": "string",
  "username": "string",
  "password": "string",
  "scope": "",
  "client_id": "string",
  "client_secret": "string"
}

Responses

200 Login successful without MFA challenge

401 Invalid credentials or MFA verification required

422 Validation Error

detailobject[]
detail[].locstring | integer[]required
detail[].msgstringrequired
detail[].typestringrequired
detail[].inputobject
detail[].ctxobject
{
  "detail": [
    {
      "loc": [
        null
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Example

curl -X POST "$PINTER_URL/api/identity/token" \
  -H "Authorization: Bearer $ACCESS_TOKEN"