Documentation menu

AuthKit-Litev2.0.0

AuthKit API reference

Try AuthKit-Lite APIs in the browser and reference authentication, passkey, user, and operations endpoints.

Updated

Browser API testing

Start AuthKit-Lite with the default configuration and open http://localhost:8080/api-test. The project-hosted console covers the available request flows and shows responses without requiring Postman or a separate frontend.

  • Use registration or the seeded demo accounts for authentication.
  • The console retains runtime tokens only in memory.
  • Protected endpoints keep the same Bearer-token, role, session, and CSRF rules documented below.
  • Enable passkeys through .env before testing successful WebAuthn ceremonies.

Authentication

Authentication endpoints
MethodPathAccessPurpose
POST/api/auth/registerPublicCreate a user; passwords require at least 12 characters
POST/api/auth/loginPublicReturn JWT access and opaque refresh tokens
POST/api/auth/refreshPublicRotate a valid refresh token and return a new token pair
POST/api/auth/logoutBearer JWTInvalidate the supplied refresh-token session
POST/api/auth/registerPublic

Create an AuthKit-Lite user. The released validation boundary requires a password of at least 12 characters.

Headers

  • Content-Type: application/json

Relevant errors

  • Validation failure for an invalid request.
  • Conflict when the requested identity already exists.

cURL

cURL
curl -X POST http://localhost:8080/api/auth/register \
  -H "Content-Type: application/json" \
  --data @registration.json
POST/api/auth/loginPublic

Verify username and password credentials and return a short-lived JWT access token with an opaque refresh token.

Headers

  • Content-Type: application/json

Request

Request
{
  "username": "developer",
  "password": "<password>"
}

Successful response

200 response
{
  "accessToken": "<jwt>",
  "refreshToken": "<opaque-token>",
  "tokenType": "Bearer",
  "expiresInSeconds": 900,
  "refreshTokenExpiresInSeconds": 1209600
}

Relevant errors

  • Unauthorized when credentials are invalid or the user is disabled.

cURL

cURL
curl -X POST http://localhost:8080/api/auth/login \
  -H "Content-Type: application/json" \
  --data '{"username":"developer","password":"<password>"}'
POST/api/auth/refreshPublic

Rotate a valid refresh token under the database lock and return a new token pair. Reuse of the previous token is rejected.

Headers

  • Content-Type: application/json

Relevant errors

  • Unauthorized when the token is invalid, expired, revoked, or already rotated.

cURL

cURL
curl -X POST http://localhost:8080/api/auth/refresh \
  -H "Content-Type: application/json" \
  --data @refresh.json
POST/api/auth/logoutBearer JWT

Invalidate the supplied refresh-token session. The current access token remains valid until its expiry.

Headers

  • Authorization: Bearer <access-token>
  • Content-Type: application/json

Relevant errors

  • Unauthorized when the Bearer token is missing or invalid.

cURL

cURL
curl -X POST http://localhost:8080/api/auth/logout \
  -H "Authorization: Bearer <access-token>" \
  -H "Content-Type: application/json" \
  --data @logout.json

Users and admin

User endpoints
MethodPathAccessPurpose
GET/api/users/meBearer JWTReturn the current user profile
GET/api/usersROLE_ADMINReturn a pageable user list
GET/api/users/me/passkeysBearer JWTList the current user's passkey metadata
GET/api/users/meBearer JWT

Return the profile represented by the validated access token.

Headers

  • Authorization: Bearer <access-token>

Relevant errors

  • Unauthorized for a missing, expired, or invalid token.

cURL

cURL
curl http://localhost:8080/api/users/me \
  -H "Authorization: Bearer <access-token>"
GET/api/usersROLE_ADMIN

Return the pageable administrative user listing.

Headers

  • Authorization: Bearer <admin-access-token>

Parameters

  • Pageable query parameters are accepted by the Spring Data boundary.

Relevant errors

  • Forbidden when the authenticated user does not have ROLE_ADMIN.

cURL

cURL
curl http://localhost:8080/api/users \
  -H "Authorization: Bearer <admin-access-token>"
GET/api/users/me/passkeysBearer JWT

List passkey metadata owned by the current user. Authenticator secrets are not returned.

Headers

  • Authorization: Bearer <access-token>

cURL

cURL
curl http://localhost:8080/api/users/me/passkeys \
  -H "Authorization: Bearer <access-token>"

Passkeys

WebAuthn endpoints
MethodPathAccessPurpose
GET/webauthn/csrfPublicCreate/read the ceremony CSRF token
POST/webauthn/register/optionsBearer JWT + CSRFCreate registration options
POST/webauthn/registerBearer JWT + CSRFComplete registration with browser attestation
DELETE/webauthn/register/{credentialId}Owner + CSRFDelete an owned credential
POST/webauthn/authenticate/optionsPublic + CSRFCreate authentication options
POST/login/webauthnPublic + CSRFComplete authentication and return AuthKit tokens

Operations and testing

Operational endpoints
MethodPathAccessPurpose
GET/actuatorPublicActuator discovery links
GET/actuator/healthPublicHealth information
GET/actuator/infoPublicApplication information
GET/api-testPublicRedirect to the browser API console