Irurueta Auth Server

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

Irurueta Auth Server is an example project: an OAuth 2.1 / OpenID Connect authorization server built from scratch with Spring Boot 4.1 and Spring Security 7.1 (which now contains Spring Authorization Server), together with the applications that use it. It exists to back a step-by-step guide in the Irurueta Docs site (Guides & References → Backend Development → SpringBoot Reference), so every code listing in that guide comes from code in this repository that compiles and passes its tests.

It is a teaching example, not a product. It is never deployed: CI only builds it and runs its tests, and publishes this documentation together with the generated reports (see Reference).

What the example covers

When complete, the example shows how to:

  • sign a browser single-page application in through a Backend-for-Frontend (BFF), so tokens never reach JavaScript

  • authenticate users with passwords stored securely, passkeys (WebAuthn), e-mail and SMS one-time codes, TOTP authenticator apps with recovery codes, and social login (Google, Microsoft Entra ID, Apple, GitHub)

  • combine those methods into multi-factor authentication with step-up, and report the result to clients in the amr, acr and auth_time claims

  • issue signed JWS / JWT access, refresh and ID tokens with persisted, rotated signing keys

  • call APIs from server to server with the client credentials grant, private_key_jwt and mTLS client authentication, and token exchange

  • explain the legacy implicit flow and migrate away from it

The work is tracked in the repository’s issues and the 1.0.0 milestone, and every item above is implemented. Users sign in through the BFF (authorization code with PKCE) with a password (Argon2 storage), a passkey, an e-mail or SMS one-time code or magic link, a social provider or an X.509 client certificate; TOTP, one-time codes, passkeys and trusted devices provide the second factor, with step-up on demand. Tokens are signed with persisted, rotating keys, clients are managed through an admin API, services authenticate with secrets, private_key_jwt or mTLS and can use DPoP, token exchange, the device grant and pushed authorization requests, and the resource server exposes a documents API protected by scopes and audience. Every authentication method is added on top of the extension points described in Architecture.

Modules

Each application below is a Maven sub-reactor split into hexagonal modules (domain, application, infrastructure/<adapter>, api/<adapter>, boot); only its boot module is runnable. The layout and the rules that enforce it are in Architecture. The root reactor also holds test-support, e2e-tests and coverage.

Module Port Role

auth-server

9000

The authorization server: Spring Authorization Server protocol endpoints, plus the login, consent, MFA and account pages.

bff

8080

The Backend-for-Frontend: an oauth2Login() client that keeps the user’s tokens in a server-side session, serves the SPA and calls the resource server on the user’s behalf.

resource-server

8081

A JWT-protected API that validates the tokens issued by auth-server.

service-client

—

A command-line client with one runner per profile: the client credentials grant (secret, private_key_jwt or mTLS, optionally DPoP), token exchange and the device authorization grant; it calls resource-server.

flowchart LR Browser["Browser SPA"] -- "session cookie" --> BFF["bff"] BFF -- "authorization code + PKCE" --> AS["auth-server"] BFF -- "access token" --> RS["resource-server"] SVC["service-client"] -- "client credentials" --> AS SVC -- "access token" --> RS RS -- "JWKS" --> AS

Next steps

  • Architecture describes the security filter chains and how authentication methods plug in.

  • Data model describes the PostgreSQL schema managed by Flyway.

  • Passwords and accounts covers password storage, the compromised-password check and the account API.

  • Tokens and signing keys covers signing keys, rotation, token claims and refresh token reuse detection.

  • Registered clients covers client seeding, the admin API and dynamic registration.

  • Resource server covers the documents API and token validation.

  • Use cases walks through every OAuth 2.0 / OpenID Connect flow step by step, with diagrams.

  • Configuration lists every configuration property, its default and its environment variable.

  • Installation explains how to build the example and run each application from source.

  • Reference lists the reports the build generates.