Documentation menu

AuthKit-Prov1.0.0

AuthKit-Pro API reference

Reference verified AuthKit-Pro authentication, account, session, provider, magic-link, and passkey endpoints.

Updated

Conventions

AuthKit-owned API bodies are JSON. Spring browser authentication endpoints use forms or native WebAuthn payloads. Bearer JWTs protect authenticated API routes; browser state-changing routes also require the CSRF cookie and X-XSRF-TOKEN header returned by /browser/csrf or /webauthn/csrf.

  • Passwords require at least 12 characters and must fit BCrypt's 72 UTF-8 byte limit.
  • Public registration, verification, and recovery responses are intentionally generic.
  • Wrong credentials return 401; ownership failures 403; invalid lifecycle credentials 400; authenticated email or identity uniqueness conflicts 409.

Core authentication

Core authentication endpoints
MethodPathAccessPurpose
POST/api/auth/registerPublicCreate a local account and request verification
POST/api/auth/loginPublicCreate an independent session and return access/refresh credentials
POST/api/auth/refreshPublicRotate a refresh credential and return a new pair
POST/api/auth/logoutBearer JWTRevoke the owned refresh family
POST/api/auth/registerPublic

Register a local username, email, and BCrypt-compatible password. The response does not reveal duplicate-account state.

Request

json
{
  "username": "developer",
  "email": "developer@example.com",
  "password": "choose-at-least-12-characters"
}

Successful response

json
{
  "message": "If registration is available, the account was created and verification requested"
}

Relevant errors

  • 400 for invalid input.
POST/api/auth/loginPublic

Authenticate a local username and password and create an independent refresh session.

Request

json
{
  "username": "developer",
  "password": "<your-password>"
}

Successful response

json
{
  "accessToken": "<jwt>",
  "refreshToken": "<opaque-credential>",
  "tokenType": "Bearer",
  "expiresInSeconds": 900,
  "refreshTokenExpiresInSeconds": 1209600
}

Relevant errors

  • 401 for invalid credentials or account state.
POST/api/auth/refreshPublic

Consume and rotate one active refresh credential. Reuse of a consumed credential compromises and revokes that session family.

Request

json
{
  "refreshToken": "<opaque-refresh-credential>"
}

Successful response

json
{
  "accessToken": "<jwt>",
  "refreshToken": "<rotated-opaque-credential>",
  "tokenType": "Bearer",
  "expiresInSeconds": 900,
  "refreshTokenExpiresInSeconds": 1209600
}

Relevant errors

  • 401 for an invalid, expired, revoked, or replayed credential.
POST/api/auth/logoutBearer JWT

Revoke the session family that owns the supplied refresh credential.

Headers

  • Authorization: Bearer <access-token>

Request

json
{
  "refreshToken": "<opaque-refresh-credential>"
}

Successful response

json
{
  "message": "Logged out successfully"
}

Relevant errors

  • 401 for a missing or invalid JWT.
  • 403 when the refresh credential is not owned by the authenticated account.

Users

User endpoints
MethodPathAccessPurpose
GET/api/users/meBearer JWTReturn the current profile, roles, enabled state, and email verification state
GET/api/usersROLE_ADMINReturn pageable user summaries

Sessions

Session endpoints
MethodPathAccessPurpose
GET/api/account/sessionsBearer JWTList own sessions and identify the current session
DELETE/api/account/sessions/{id}Bearer JWTRevoke one owned session
DELETE/api/account/sessions/othersBearer JWTRevoke every session except the current sid
DELETE/api/account/sessionsBearer JWTRevoke all sessions, including current

Email verification

Email verification endpoints
MethodPathAccessPurpose
POST/api/auth/verification/requestPublicRequest a verification message for an email address
POST/api/auth/verification/confirmPublicConsume a verification token
POST/api/auth/verification/requestPublic

Request verification without revealing whether the account exists.

Request

json
{
  "email": "developer@example.com"
}

Successful response

json
{
  "message": "If the account is eligible, an email will be sent"
}
POST/api/auth/verification/confirmPublic

Consume a single-use verification credential.

Request

json
{
  "token": "<verification-token>"
}

Successful response

json
{
  "message": "Email verified"
}

Relevant errors

  • 400 for an invalid, expired, consumed, or wrong-purpose token.

Password lifecycle

Password lifecycle endpoints
MethodPathAccessPurpose
POST/api/auth/password/forgotPublicRequest a password-reset message
POST/api/auth/password/resetPublicConsume a reset token and set a new password
POST/api/account/passwordBearer JWTVerify the current password and set a new password

Email change

Email-change endpoints
MethodPathAccessPurpose
POST/api/account/emailBearer JWTProve the current password and request verification at a new address
POST/api/auth/email/confirmPublicVerify and commit the replacement email

Administration

Administration endpoints
MethodPathAccessPurpose
POST/api/admin/users/{id}/stateROLE_ADMINEnable or disable an account from { "enabled": true|false }

Security activity

Security activity endpoint
MethodPathAccessPurpose
GET/api/account/activityBearer JWTReturn own pageable activity history; maximum page size 100

External identities

External identity endpoints
MethodPathAccessPurpose
GET/api/account/identitiesBearer JWTList own provider metadata without provider tokens
DELETE/api/account/identities/{id}Bearer JWTProve the current password and unlink an owned identity

Browser OAuth and CSRF

Browser OAuth endpoints
MethodPathAccessPurpose
GET/browser/csrfPublicCreate/read browser CSRF cookie and header token
POST/oauth2/link/{registrationId}Bearer JWT + CSRFProve the current password and begin explicit account linking
GET/oauth2/authorization/{registrationId}Spring OAuth entryBegin authorization for a configured provider
GET/login/oauth2/code/{registrationId}Spring callbackVerify provider response and return AuthKit tokens as JSON

Passkeys and WebAuthn

WebAuthn endpoints
MethodPathAccessPurpose
GET/webauthn/csrfPublicCreate/read ceremony CSRF state
POST/webauthn/register/optionsBearer JWT + CSRFCreate native registration options
POST/webauthn/registerBearer JWT + CSRFComplete native credential registration
DELETE/webauthn/register/{credentialId}Credential owner + CSRFDelete an owned credential
POST/webauthn/authenticate/optionsPublic + CSRFCreate native assertion options
POST/login/webauthnPublic + CSRFComplete native authentication and return AuthKit tokens
GET/api/users/me/passkeysBearer JWTList own passkey metadata