Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ricardomb-tech/auth-service/llms.txt

Use this file to discover all available pages before exploring further.

Auth Service is a stateless Spring Boot 3 microservice that centralises authentication and authorisation for your platform. It handles account registration with email verification, credential-based login, JWT + refresh-token issuance with rotation and reuse detection, logout, password reset, and federated login via Google and GitHub (OAuth2). Every error response follows Problem Details (RFC 9457) so all error shapes are uniform regardless of where in the request lifecycle they originate.

Base URL

EnvironmentURL
Developmenthttp://localhost:8080
ConfigurableSet APP_BASE_URL environment variable

Authentication

All /auth/** endpoints are public — no token is required. Protected endpoints (e.g. GET /api/v1/users/me) require a valid JWT access token in the Authorization header:
Authorization: Bearer <accessToken>
The service uses a deny-all security policy by default: every new route is protected until it is explicitly declared public in SecurityConfig.

Content Type

DirectionHeader
Request bodyContent-Type: application/json
Successful responseContent-Type: application/json
Error responseContent-Type: application/problem+json

Error Format

All errors — whether produced by the Spring Security filter chain or by the application-layer GlobalExceptionHandler — are returned as Problem Details (RFC 9457) with Content-Type: application/problem+json.
{
  "type": "about:blank",
  "title": "Unauthorized",
  "status": 401,
  "detail": "Full authentication is required to access this resource.",
  "instance": "/api/v1/users/me"
}
The detail field contains a human-readable explanation. The status field mirrors the HTTP status code. The instance field reflects the request path.

Endpoint Summary

MethodPathAuth RequiredDescription
POST/auth/registerNoRegister a new account; sends a verification email. Anti-enumeration: always returns 202.
POST/auth/resend-verificationNoRe-send the verification email if the account is still pending. Anti-enumeration: always returns 202.
POST/auth/verifyNoActivate an account using the token from the verification email.
POST/auth/loginNoValidate credentials and issue a JWT access token + opaque refresh token.
POST/auth/refreshNoExchange a valid refresh token for a new access + refresh token pair. Detects and blocks token reuse.
POST/auth/logoutNoRevoke a refresh token. Idempotent — always returns 204.
POST/auth/forgot-passwordNoRequest a password-reset email. Anti-enumeration: always returns 202.
POST/auth/reset-passwordNoSet a new password using a valid single-use reset token.
GET/oauth2/authorization/googleNoInitiate the Google OAuth2 login flow (redirects to Google).
GET/oauth2/authorization/githubNoInitiate the GitHub OAuth2 login flow (redirects to GitHub).
POST/auth/oauth2/exchangeNoExchange the one-time code issued after a successful federated login for an access + refresh token pair.
GET/api/v1/users/meYesReturn the authenticated account’s profile.

Swagger UI

Interactive API documentation is available at:
http://localhost:8080/swagger-ui.html
The raw OpenAPI spec is at /v3/api-docs.

Build docs developers (and LLMs) love