AAuthfy Docs

External API overview

The Auth API endpoints external applications use for SSO, token verification, company directory lookups, category lookups, and application-access checks.

Base URL

Local development default:

http://localhost:8081

All application endpoints are versioned under /api/v1.

Security model for external apps

External apps integrate against an application record, not a company. Each application owns:

The application public key identifies the calling app, but it is not a secret. It is accepted only together with a valid app-signed user JWT or the OAuth flow proof (authorization code + PKCE verifier, or a current refresh token).

For company directory and access-control endpoints under /api/v1/external/**, send both:

Authorization: Bearer <app-signed-user-access-token>
X-App-Public-Key: -----BEGIN PUBLIC KEY-----\nMIIB...\n-----END PUBLIC KEY-----

Rules enforced by the API:

For headers, send the PEM with escaped newlines (\n) or send the base64 public-key body. Never embed the application private key anywhere outside the Auth service.

Pagination and search

Paged endpoints use Spring pageable query parameters:

ParameterExampleNotes
page0Zero-based page number.
size50Page size.
sortname,ascCan be repeated for multiple sorts.
searchfinanceSupported on company users, categories, and applications.

Paged responses follow the standard Spring Page shape:

{
  "content": [],
  "pageable": {},
  "totalElements": 0,
  "totalPages": 0,
  "size": 50,
  "number": 0
}

Public auth endpoints

These endpoints do not require an Authorization header. They are used only by the Authfy UI and never produce application JWTs:

MethodEndpointPurpose
POST/api/v1/auth/loginAuthenticate a user; returns internal Authfy UI tokens (HMAC-signed).
POST/api/v1/auth/refreshRotate the internal UI refresh token.
POST/api/v1/auth/introspectValidate an application JWT. Requires X-App-Public-Key or appPublicKey in the body.

External apps must use the OAuth/OIDC flow — not /api/v1/auth/login — to obtain tokens.

Introspect an application JWT

POST /api/v1/auth/introspect
Content-Type: application/json
X-App-Public-Key: -----BEGIN PUBLIC KEY-----\nMIIB...\n-----END PUBLIC KEY-----

{
  "token": "eyJhbGciOiJSUzI1NiJ9..."
}

Active response:

{
  "active": true,
  "subject": "user-uuid",
  "tokenType": "access",
  "claims": {
    "sub": "user-uuid",
    "email": "member@example.com",
    "company_id": "company-uuid",
    "company_slug": "company-slug",
    "application_id": "application-uuid",
    "app_id": "hrm",
    "public_key_fingerprint": "sha256-fingerprint",
    "token_type": "access"
  }
}

Operational endpoints

MethodEndpointPurpose
GET/healthHealth check.
GET/infoApplication info.
GET/actuator/healthSpring actuator health check.
GET/actuator/infoSpring actuator info.
GET/swagger-ui/**Swagger UI where enabled.
GET/v3/api-docs/**OpenAPI JSON where enabled.

Endpoints not intended for external apps

/api/v1/admin/** endpoints are reserved for Authfy administrators. External applications should use /api/v1/oauth/**, /api/v1/external/**, and /api/v1/me/apps instead.

In this section