Installation

This documentation was generated with the assistance of AI. Please report any inaccuracies.

Irurueta Auth Server is an example project, so it is not published as a package. Build and run it from source.

Prerequisites

  • JDK 21 to 25. The build enforces [21,26): SpotBugs cannot parse class files of JDK 26 or newer.

  • Docker, for the integration tests (Testcontainers) and for the local services the applications will use.

  • Maven is optional: the repository ships the Maven wrapper (./mvnw).

Build and test

git clone https://github.com/albertoirurueta/irurueta-auth-server.git
cd irurueta-auth-server
./mvnw verify

./mvnw -B clean verify compiles every module, runs the unit tests (*Test, Surefire) and the integration tests (*IT, Failsafe), runs every build gate (see Build gates) and writes the reports. It must be green before pushing. ./mvnw test is the fast loop: unit tests only, no Spring context and no Docker. The current version is 1.0.0-SNAPSHOT.

To run a single test class in a single module:

./mvnw -pl auth-server/api/web -am test -Dtest=LoginControllerTest

The root compose.yaml starts PostgreSQL 18 and Mailpit for local development. The integration tests do not use it: they start their own PostgreSQL container through the test-support module (@PostgresIT). The e2e-tests module is built after the applications and runs a Playwright sign-in smoke test (SignInSmokeIT) against the packaged auth-server/boot and bff/boot jars; Playwright downloads its Chromium build on first use.

Run the applications

Run auth-server with the dev profile: it starts the services of compose.yaml through spring-boot-docker-compose (PostgreSQL, and Mailpit on SMTP port 1025 and web UI port 8025), applies the Flyway migrations and seeds a demo user and a confidential bff client with generated secrets, which it writes to its log. Export the client secret as BFF_CLIENT_SECRET before starting the bff.

The bff keeps its sessions in PostgreSQL. With the dev profile it uses the bff database of the same compose PostgreSQL (created by compose/init-databases.sql) and applies its Flyway migration at start; start it with -Dspring-boot.run.profiles=dev. Without the dev profile it reads the connection from the environment:

Variable Meaning Default

BFF_DB_URL

JDBC URL of the bff database.

jdbc:postgresql://localhost:5432/bff

BFF_DB_USER, BFF_DB_PASSWORD

Credentials of that database.

bff / empty

BFF_CLIENT_SECRET

Secret of the bff client, as seeded by auth-server. Required.

none

AUTH_ISSUER

Issuer URI of auth-server.

http://localhost:9000

RESOURCE_SERVER_URI

Base URI of the resource-server the BFF’s generated documents client calls (bff.resource-server.base-uri).

http://localhost:8081

To let the bff and the demo SPA send users back after sign-out, auth-server must know their post-logout URIs: set AUTHSERVER_BFF_POST_LOGOUT_REDIRECT_URIS and AUTHSERVER_SPA_POST_LOGOUT_REDIRECT_URIS (comma-separated; the dev profile already sets them). See Login pages and the BFF and Registered clients.

The dev profile data and the compose credentials are throwaway development values. Signing keys are persisted in PostgreSQL, encrypted with a per-machine random secret that the dev profile creates once under ~/.irurueta-auth-server/. Outside the dev profile, set authserver.keys.encryption.password and authserver.keys.encryption.salt (see Tokens and signing keys) and, to seed the bff client, AUTHSERVER_BFF_CLIENT_SECRET. The compromised-password check calls the Have I Been Pwned range API; disable it with authserver.password.compromised-check.enabled=false when offline.

Start each application in its own terminal, auth-server first. The dev profile finds compose.yaml at ../../compose.yaml, relative to the working directory, which spring-boot:run sets to the auth-server/boot module directory. When starting the jar or an IDE run configuration from elsewhere, point to the file with SPRING_DOCKER_COMPOSE_FILE=<repository>/compose.yaml.

./mvnw -pl auth-server/boot -am spring-boot:run -Dspring-boot.run.profiles=dev
./mvnw -pl resource-server/boot -am spring-boot:run
./mvnw -pl bff/boot -am spring-boot:run -Dspring-boot.run.profiles=dev
./mvnw -pl service-client/boot -am spring-boot:run
Application Address

auth-server

http://localhost:9000

bff

http://localhost:8080

resource-server

http://localhost:8081

service-client

No HTTP port: it runs, calls the API and exits.

Build the documentation

Building this documentation site requires Node.js 24 or newer:

cd docs
npm ci
npx antora antora-playbook.yml

The site is written to docs/build/site.