All Classes and Interfaces

Class
Description
 
Self-service account endpoints: registration, e-mail verification, password change and password reset.
Translates the failures of AccountController to RFC 9457 problem details, answered as application/problem+json.
Port that sends the e-mails of the account lifecycle.
An account message could not be delivered.
Rate limiter of the unauthenticated account endpoints (register, verify, reset request, reset), built on Bucket4j token buckets (FixedWindowBuckets).
A client address or an e-mail address made more account requests than its window allows.
Configuration of the rate limiting of the unauthenticated account endpoints (authserver.account.rate-limit.*).
A UserDetailsService that refuses a disabled, locked or expired account.
A single-use token that proves the right to perform one account operation.
Port that stores single-use account tokens.
Maps a row of the account_tokens table to an AccountToken.
Use case that finds the one key that signs new tokens.
Encrypts and decrypts the private half of signing keys with AES-256-GCM (Spring Security's Encryptors.stronger).
TotpSecretCipher that encrypts TOTP secrets with AES-256 in GCM mode.
The trust manager of the dedicated TLS port: it accepts any client certificate and advertises no certificate authority.
 
 
 
 
 
 
 
 
 
Security filter chain of the REST API under /api/**: stateless, bearer tokens issued by this server and validated by a decoder of its own (never the framework-wide one, which also serves the UserInfo endpoint).
Customizes the authorization request: Apple only hands over the name and the e-mail address of the user when the response is posted to the redirect URI (response_mode=form_post), so the request made for Apple's client id asks for it.
Generates the client secret Sign in with Apple requires: a JWT signed with ES256 by the key Apple issued (iss the team id, sub the client id, aud https://appleid.apple.com, header kid the key id), valid for a short time.
Reads the private key Apple issues for Sign in with Apple (an EC P-256 key in PKCS#8 PEM form, the content of the .p8 file) from the text an environment variable holds, where line breaks are often written as a literal \n.
Condition that holds when Sign in with Apple is configured, so the key of its client secret is only parsed and its special handling (the signed client secret, the form post callback) only installed then.
Customizes the parameters of the token request of the authorization code grant: the request made for Apple's client id carries the signed JWT of AppleClientSecretGenerator as its client_secret, in place of the empty secret the registration holds.
Enables @Async methods for every feature of the application (the delivery of one-time tokens after their transaction commits, ...), which then run on Spring Boot's applicationTaskExecutor.
Decorates an introspector of the opaque-token variant: rejects tokens whose audience is not accepted and adds the role authorities of the roles attribute, so the opaque variant behaves like the JWT one.
 
 
 
Authentication context class references (acr) that this server reports and understands.
A way of authenticating, as registered by a feature.
Registry of the authentication factors this server knows.
How the service client authenticates at the token endpoint (service-client.auth.method).
The framework's own answer to a granted authorization code request, repeated because installing a response handler replaces it and the framework does not expose it: a redirect to the redirect URI with code and, when the request had one, state in the query.
Extension point that adds a Jackson module to the mapper of the stored authorizations (AuthorizationJsonMapperFactory), for a feature whose authentication or attribute types the framework's security modules do not cover (for example the passkeys, whose module Spring Security leaves out of SecurityJacksonModules).
Creates the JSON mapper that serializes the attributes and token claims stored with each authorization.
Entry point of the auth-server application.
Base32 encoding (RFC 4648) without padding, the form authenticator applications expect for a shared secret.
Maps the roles claim of a token onto authorities, for both JWT and opaque tokens.
Entry point of the bff application.
Points the BFF at its own bff database when, in the dev profile, Spring Boot's Docker Compose support supplies the datasource.
Connection details of the compose PostgreSQL, addressing the bff database.
Starts the OpenID Connect login, as the contract apis/bff/rest-server/bff-api-v1.yaml describes it through the generated LoginApi.
Answers a login request whose parameters break the constraints of the contract (returnTo too long, acrValues of the wrong format, maxAge out of range) with 400, as the contract declares: the validation of the generated interface throws a ConstraintViolationException, which would otherwise be a 500.
Configuration of the BFF login (bff.login.*).
The certificate to bind
Use case that binds a client certificate to an account and audits it.
Enables the binding of BrandingProperties.
Branding shown by the login, consent, logout and error pages, bound from authserver.ui.branding.*.
Supplies the BrandingProperties every server-rendered page shows, as the "branding" model attribute: the page renderer and the error view resolver add it to the model of each page they render.
A JSON Web Key set loaded lazily and kept in memory for a short time, so that verifying or signing a token does not read the database every time.
An X.509 client certificate bound to the account
Thrown when a certificate is already bound to another account: one certificate belongs to one account only.
The binding of a client certificate to an account: the certificate is recognised by the SHA-256 fingerprint of its encoded form, never by its subject, which anyone can choose.
Port that stores the client certificates bound to accounts.
Maps a row of x509_certificates to a CertificateBinding.
Manages the client certificates bound to the authenticated account (the operations of the contract).
Maps the certificate bindings of the domain onto the DTO generated from the contract.
Answers the failures of the certificates API as application/problem+json.
Thrown when an account has no bound certificate with the requested identifier.
Takes the SHA-256 fingerprint of the client certificate as the principal, as 64 lower case hexadecimal digits, which is what a binding stores and what ResolveCertificateLoginUseCase looks up.
 
Change of the password of the authenticated account
Use case that lets a signed-in user choose a new password.
Use case that tells whether the second factor of a user is locked after too many failed attempts.
Use case that deletes the account tokens (password reset links) that have expired, used or not: once expired they can never be consumed, so keeping them only grows the table.
Use case that deletes the authorizations whose tokens have all expired, and the abandoned ones: authorization or consent requests that never got a token and are older than a threshold.
Use case that deletes the trusted devices that have expired, since they can never be used again.
Deletes what the one-time-code and SMS features leave behind: expired codes, expired pending phone verifications, cost ledger rows older than the retention and expired magic-link tokens.
Beans of the client-credentials and token-exchange runners, present only under those profiles.
Administration of the registered clients, as the contract apis/auth-server/rest-server/auth-server-api-v1.yaml describes it through the generated ClientsApi.
A client with that identifier is already registered.
Scheduled entry point that deletes the identifiers of the client assertions that already expired.
Settings of the client assertions, bound from authserver.client-assertion.* once and validated at startup.
Settings of the purge of expired identifiers.
Port that remembers the identifiers (jti) of the client assertions already accepted, so an assertion cannot be presented twice.
One presentation of a client assertion: which client presented which JWT identifier, and until when the assertion is valid (after that instant the identifier no longer needs to be remembered).
Wires the client authentication methods private_key_jwt (with replay protection) and mutual TLS into the protocol chain.
Installs private_key_jwt with replay protection and the mutual-TLS client authentication in the protocol chain: the framework's assertion provider decodes with RegisteredJwksClientAssertionDecoderFactory, and its certificate provider verifies with ClientCertificateVerifier.
Verifies the certificate a client presented on the TLS port (RFC 8705), replacing the framework's verifier, which has no trust anchors of its own.
Command-line client of the OAuth 2.0 client credentials grant: obtains an access token with its own credentials, lists the documents the resource server shows it and prints each one as a JSON line.
Maps between the DTOs generated from the contract and the client registrations of the domain, so a domain model is never returned from ClientAdminController.
Translates the failures of ClientAdminController to RFC 9457 problem details, answered as application/problem+json.
Parses and validates the public JWK set a client registers for private_key_jwt and self-signed mutual TLS authentication, and converts it between the JSON object of the contract and the JSON text the domain keeps.
No client is registered with that identifier.
An OAuth 2.1 client registered with the authorization server.
Maps the settings of the enabled providers onto the client registrations Spring Security's oauth2Login needs.
Port that stores registered clients.
Definition of a registered client; it never contains a secret, which the server generates
JWS algorithm a client signs its private_key_jwt assertions with.
A registered client, without any secret
JWS algorithm a client signs its private_key_jwt assertions with.
 
Generates random client secrets.
The new client secret; it is shown only once
Seeds the configured default clients at startup.
Configuration of the seeding of the default clients (authserver.clients.*).
Seeding of one default client.
Writes the lines a person (or a test) reads from the client-credentials and token-exchange runners.
Settings of the client-credentials and token-exchange runners (service-client.cli.*).
Provides the Clock the use cases read the current time from, so tests can replace it with a fixed one.
Port that tells whether a password is known to have leaked in a data breach.
Registers the CompromisedPasswordCheck port.
The chosen password is known to be compromised.
Confirms a phone with the code that was sent to it.
Use case that confirms the enrolment of an authenticator app inside the sign-in, where the code also stands as the second factor of that sign-in: like VerifyTotpUseCase, a locked second factor is refused, a wrong code counts towards the lockout and a right one clears the counter and is audited.
A code produced by the authenticator app
Use case that finishes the enrolment of an authenticator app with the first code it shows.
Serves the consent page the authorization endpoint redirects to when a client needs the user's approval, as the contract apis/auth-server/web-pages/auth-server-pages-v1.yaml describes it through the generated ConsentPageApi.
 
View model of the consent page.
A scope and its description.
Builds the ConsentPageModel from the registered client, the requested scopes and the scopes granted earlier.
Points the authorization endpoint at the custom consent page instead of the framework's generated one.
Use case that counts the recovery codes a user still has, so the UI can warn when few are left.
Use case that registers a client.
The result of creating a client.
The created client; the secret is shown only once
A trusted device just created, with the signed cookie value that is only available now.
Use case that trusts the browser of a user for some days so it skips the second factor.
Makes the CSRF token reach the single page application.
The account an API request is made on behalf of: the owner of the bearer token.
Resolves the account of the request being handled.
Serves the signing keys kept by the key use cases.
The single definition of the clients a deployment can start with: the confidential bff (backend for frontend) and the public spa-public.
Use case that deletes a registered client.
Use case that deletes one document of the signed-in user.
Use case that deletes a document on behalf of a caller.
Use case that deletes a passkey of a user and audits the removal.
Delivers what the one-time token use cases asked for: an e-mailed code or link, or a text message whose cost was already recorded.
Seeds a demo user, a confidential BFF client and a public device-flow client when the dev profile is active, so a freshly started authorization server has someone to sign in, a client to sign in through and a client for the OAuth 2.0 Device Authorization Grant (device-client, which the polling command line tool of the service-client uses).
Response of the device authorization endpoint (RFC 8628 section 3.2).
Calls the standard device flow endpoints of the authorization server.
Error response of the token endpoint (RFC 6749 section 5.2).
Reads the identifier of a public client of the device flow, the only kind of client authentication that flow has for a device that cannot keep a secret: the client_id of the request to the device authorization endpoint and of the polling request to the token endpoint with the device code grant.
Authenticates a public client of the device flow by its identifier: the client must be registered and must have registered the none authentication method, which is what makes it public.
The request of a public client of the device flow to be authenticated by its identifier alone.
Installs the device authorization grant in the protocol chain.
Command-line client of the OAuth 2.0 device authorization grant (RFC 8628): requests a device code, prints the user code and the verification URI, then polls the token endpoint honouring interval, slow_down, authorization_pending and expired_token.
Beans of the device flow CLI, present only under the "device-flow" profile.
The device flow could not finish: the request failed, the user denied it, the device code expired or the program was interrupted.
Writes the lines a person (or a test) reads.
Settings of the device flow CLI, bound from device-flow.* (command-line arguments or environment variables such as DEVICE_FLOW_ISSUER).
Enables the OAuth 2.0 Device Authorization Grant on the protocol chain.
Configuration of the limit on the attempts to verify a user code (authserver.device.rate-limit.*): the user code is short, so the attempts a signed-in user and a client address may make in a window are bounded, on top of the expiry of the code itself.
Serves the device verification page, as the contract apis/auth-server/web-pages/auth-server-pages-v1.yaml describes it through the generated DeviceVerificationPageApi: the form where the user types the code the device shows.
Error handler of the device verification endpoint.
 
Raised while a device verification request is converted when its client address or user made too many attempts.
Rate limiter of the attempts to verify a user code, on the pattern of the other limiters of this server: Bucket4j token buckets in Caffeine caches (FixedWindowBuckets), one per client address and one per signed-in user, so a user code, which is short, cannot be guessed faster than the limits allow.
Guards the device verification endpoint.
Provides the key-encryption inputs when the dev profile is active, so a developer does not have to configure anything: a random passphrase and salt are generated once per machine, stored in a file under ~/.irurueta-auth-server/ that only the owner can read, and reused at every start, which keeps the signing keys persisted in the development database decryptable across restarts.
Development only (dev profile): opens the SMS inbox page to everybody in the login chain, so an end-to-end test can read the codes the logging sender recorded without signing in.
Development only (dev profile): renders the SMS messages the logging sender recorded instead of sending them, so a developer or an end-to-end test can read the code of a sign-in or of a phone enrolment.
 
Provides the server certificate of the dedicated TLS port when the dev profile is active and none is configured, so a developer does not have to create one: a self-signed certificate for localhost is generated once per machine with the JDK's keytool, stored in a key store under ~/.irurueta-auth-server/ that only the owner can read (its password in a file next to it, as DevKeyEncryptionSecret keeps its secret) and reused at every start.
Use case that removes the authenticator app of a user together with the recovery codes that went with it.
A document owned by a user, as the resource server holds it.
A document owned by a user.
A document owned by a user, as the resource server lists it.
The documents could not be read: no token could be obtained, the resource server refused it or it is unreachable.
Lists the documents through a generated client and translates every failure into a DocumentAccessException, so no HTTP, OAuth2 or JSON type escapes through the ports.
Documents API, as the contract apis/resource-server/rest-server/resource-server-api-v1.yaml describes it through the generated DocumentsApi.
Maps the domain documents onto the DTO generated from the contract; a controller never returns a domain model.
Maps domain documents onto the DTO generated from the contract, so a domain model is never returned from DocumentController.
Port to the documents the signed-in user keeps on the resource server.
Port to the documents on the resource server, read with the token the service client obtained for itself (client credentials).
Maps the model of the generated resource-server client onto the domain, so the generated types never leave this adapter.
Maps the documents the resource server answers onto the domain.
The document does not exist, or it belongs to someone else (the two are deliberately indistinguishable).
Port that provides and stores documents.
A document owned by a user, as the resource server keeps it.
A document owned by a user.
A document owned by a user.
A document owned by a user.
 
 
 
 
Builds the documents client generated from the resource server's contract on top of a REST client that sends the access token of an authorized client (so the generated client's own authentication settings stay unused).
Lists and deletes the documents of the signed-in user, as the contract apis/bff/rest-server/bff-api-v1.yaml describes them through the generated DocumentsApi.
Translates the failures of DocumentsController to RFC 9457 problem details.
The signed-in user is not allowed to perform the operation on the documents, for example because the access token lacks the scope it needs.
The resource server refused the operation because the access token of the session does not prove a strong or recent enough authentication (RFC 9470 step-up).
The session of the signed-in user holds no valid access token: there is none, or it expired and cannot be renewed.
The documents cannot be reached: the resource server is unreachable or failed to answer.
Sends the access token of an authorized client as Authorization: DPoP <token> together with a DPoP proof that binds the request and the token, when the token is DPoP-bound.
Creates the DPoP proofs (RFC 9449) of the service client.
Enables the OpenID Connect dynamic client registration endpoint (/connect/register) when authserver.oidc.client-registration.enabled=true.
An e-mail address of the GitHub user
Event published when a one-time code must be e-mailed.
Event published when a magic link must be e-mailed.
Use case that starts the enrolment of an authenticator app: it generates a secret, stores it encrypted and unconfirmed (replacing any earlier unconfirmed one) and returns the otpauth:// URI to show as a QR code.
Validates the issuer of an ID token of Microsoft Entra ID in a multi-tenant application.
Chooses the error page Spring Boot's BasicErrorController renders for a browser: the error template with a generic text picked from the status only, and the branding.
Extension point for customizing exceptions thrown by the generated API client.
Extension point for customizing exceptions thrown by the generated API client.
Extension point for customizing exceptions thrown by the generated API client.
Scheduled entry point that deletes the expired account tokens (password reset links), next to the clean-up of the expired authorizations.
Periodically deletes the expired and the abandoned authorizations.
Port that removes the expired magic-link tokens.
Adds the authority of a verified factor to an authentication.
How much an authentication factor proves on its own.
Reads, from the FactorGrantedAuthority instances of an authentication, the factors that prove something about it and when they were presented.
Finds the local account of a sign-in with an external provider and refuses it unless that account may sign in.
Failure handler of the sign-in with an external provider.
Success handler of the sign-in with an external provider.
Registers the sign-in with an external provider as an authentication factor, in two flavours that are never held together by one session: FederatedFactor.AUTHORITY (fed, a FactorStrength.PRIMARY factor): the normal case.
Decides which factor a federated sign-in proved: the strong one when the provider is trusted for its multi-factor authentication (authserver.social.providers.<id>.trust-mfa) and its upstream amr contains mfa, the ordinary one otherwise.
An identity of an external provider linked to a local account: the account is reached by presenting the provider's stable subject, never by its e-mail address, which a provider may change.
Thrown when an identity of an external provider is already linked to another account: one external identity belongs to one account only.
Thrown when an account has no linked identity with the requested identifier.
Port that stores the identities of external providers linked to accounts.
Maps a row of federated_identities to a FederatedIdentity.
Adds the module of the OAuth 2.0 client to the mapper of the stored authorizations.
Rules of identity brokering: when an external identity may be tied to an account, and when it may be removed.
The account a sign-in with an external provider resolved to.
How a sign-in with an external provider found its account.
Thrown when a sign-in through an external provider is refused: the provider did not vouch for the e-mail address, or the address belongs to an account whose own address was never verified.
The user service of the providers that are plain OAuth 2.0 (GitHub), which have no ID token: the framework's service reads the profile from the provider's API, the verified primary e-mail address is read from /user/emails (through the domain port VerifiedEmailLookup, implemented by the GitHub adapter of infrastructure/github with a client generated from the contract of that GitHub operation), the account is resolved (found, linked by verified e-mail or provisioned, and refused when it may not sign in) and the principal becomes the local one, named after the account.
The user service of the OpenID Connect providers (Google, Microsoft, Apple): the framework's service loads the user as it always does (the ID token, and the UserInfo endpoint where the provider has one), then the account is resolved (found, linked by verified e-mail or provisioned, and refused when it may not sign in) and the principal becomes the local one, named after the account.
Maps the user an external provider described onto the user the rest of the server sees: the principal of the session, whose name is the local account's username (so it is the sub of the issued tokens, as it is for every other way of signing in), whose authorities are the account's own, and which still carries the claims of the provider (the amr among them).
Use case that finds the usable (not revoked, not expired) trusted device of a user from the value of the cookie.
Use case that looks a user account up by username.
Finds the verified phone of a user, which the account API shows masked.
The token buckets of one kind of key (a client address, an e-mail address, an identifier), built on Bucket4j and kept in a Caffeine cache.
Bucket4j and Caffeine time source backed by a Clock.
Reads the client certificate a reverse proxy that terminates TLS forwards in a header and leaves it where the servlet container leaves a certificate of its own, in the jakarta.servlet.request.X509Certificate request attribute, so the same X.509 filter and principal extractor serve both transports.
Port that remembers which accounts only hold a password the server generated and nobody knows: the accounts created by the first sign-in with an external provider.
Use case that creates a fresh set of recovery codes for a user, replacing any previous set.
Use case that looks a client up by its identifier.
Maps the e-mail addresses GitHub lists onto the one address the domain wants: the address GitHub marks as both primary and verified.
Builds the users client generated from the GitHub contract for one call.
VerifiedEmailLookup over GitHub's GET /user/emails, called through the client generated from apis/github/rest-server/github-api-v1.yaml.
Use case that tells whether a user has registered a passkey.
Use case that tells whether a user has confirmed any second factor, asking every SecondFactorEnrolmentQuery bean.
Tells whether a user has a verified phone.
TrustedDeviceTokenSigner that signs the trusted-device cookie with HMAC-SHA256, under a key derived from the key-encryption secret for this purpose only (PurposeKeyDerivation).
 
 
 
 
 
 
 
 
Keeps the identities page and its link post behind the multi-factor policy, as the passkeys and phone pages are: a session that only presented the password of an account that still has to complete its second factor is sent to the second-factor page instead of being able to add a way to sign in to the account.
Declares the chain customizer of the identities page.
Serves the account page of the linked identities and the form post that starts linking another one, as the contract apis/auth-server/web-pages/auth-server-pages-v1.yaml describes them through the generated IdentitiesPageApi.
An identity of an external provider linked to the account
The provider that holds the identity.
Manages the identities of external providers linked to the authenticated account (the operations of the contract).
Maps the linked identities of the domain onto the DTO generated from the contract.
Answers the failures of the identities API as application/problem+json.
External identity providers an account can be linked to.
What the identities page shows of a linked identity.
Maps the linked identities of the domain onto the view model of the identities page.
Adds to the tokens of a user who signed in with an external provider the claim idp (the registration id of the provider).
Chooses the validator of the ID token of each registration: the framework's OidcIdTokenValidator, plus the EntraIssuerValidator for Microsoft (registered without an issuer, see ClientRegistrationMapper).
A client with the legacy implicit grant was submitted through the administration API: only the demo client seeded under the legacy-implicit profile may have that grant, so the implicit flow never reaches a deployment that did not opt in to it.
Document store kept in process memory.
Thrown by StepUpGuard when the bearer token of an API call does not show a recent enough multi-factor sign-in for the operation.
The presented account token is unknown, expired, already used or issued for another purpose.
Thrown when the value sent to bind a certificate is not a single PEM X.509 certificate within its validity period.
Raised when the public JWK set of a client is not a valid JWK set, is empty or holds a key with private material.
The username or the current password is wrong.
Thrown when the label given to a passkey is refused: blank, or longer than allowed once trimmed.
The chosen password breaks the PasswordPolicy.
The verification code of a phone number is wrong, has expired or there is no verification in progress.
Thrown when the text typed as a phone number is not a valid number.
Thrown when the code presented to confirm the enrolment of an authenticator app is wrong.
Use case that tells whether a client makes multi-factor authentication mandatory for every user signing in through it (ClientRegistration.mfaRequired()).
The claims this server adds to the tokens it issues, whatever their format, so the self-contained (JWT) access tokens and the reference (opaque) ones carry the same claims: RolesTenantAudienceTokenCustomizer applies it to the JWTs and ReferenceTokenClaimsCustomizer to the claims stored for a reference token (which the introspection endpoint returns).
Use case that tells whether a user has a confirmed authenticator app.
Use case that tells whether the account of a user requires a second factor, whatever the client being served: when an administrator forced it (users.mfa_required) or when the user has confirmed a second factor (asked to HasConfirmedSecondFactorUseCase), since a factor the user enrolled must protect every sign-in.
Class that add parsing/formatting support for Java 8+ OffsetDateTime class.
Class that add parsing/formatting support for Java 8+ OffsetDateTime class.
Class that add parsing/formatting support for Java 8+ OffsetDateTime class.
AccountTokenRepository over the account_tokens table.
Registers the JDBC implementations of the Spring Authorization Server persistence services.
CertificateBindingRepository over the x509_certificates table.
ClientAssertionReplayRegistry over the client_assertion_jtis table.
ClientRegistrationRepository over Spring Authorization Server's RegisteredClientRepository (the JDBC one), which reads and writes the oauth2_registered_client table.
ExpiredLinkTokenPurger over Spring Security's one_time_tokens table (magic links).
FederatedIdentityRepository over the federated_identities table.
GeneratedPasswordRepository over the generated column of user_passwords.
OneTimeCodeRepository over the ott_codes table.
PasskeyRepository over the user_credentials and user_entities tables that Spring Security's WebAuthn repositories own.
PhoneVerificationRepository over the pending_* columns of the user_phones table.
RecoveryCodeRepository over the recovery_codes table.
SecondFactorAttemptRepository over the second_factor_attempts table.
SecurityEventRepository over the security_events table.
SigningKeyRepository over the signing_keys table.
SignInMethodsLock over a PostgreSQL transaction-level advisory lock on the account: it opens no transaction and holds the lock until the caller's ends, so the removals of the sign-in methods of one account (unlinking an identity, unbinding a certificate) run one after the other and each counts what the previous one left.
SmsCostLedgerRepository over the sms_cost_ledger table.
Converts between the domain's Instant and the OffsetDateTime the PostgreSQL driver binds to and reads from a timestamp with time zone column.
TotpCredentialRepository over the totp_credentials table.
TrustedDeviceRepository over the trusted_devices table.
UserAccountRepository reading user accounts from the users, user_authorities and user_passwords tables.
UserAuthorizationRepository over the oauth2_authorization table.
UserMfaSettingsRepository over the mfa_required column of the users table.
UserPhoneRepository over the verified columns of the user_phones table.
Drops every cached JWK set when the signing keys rotate, so the next token or JWKS request sees the new keys without waiting for the cache to expire.
Extension point that lets a feature add claims to the tokens issued by the authorization server: the access tokens, whether self-contained (JWT) or reference (their claims are returned by the introspection endpoint), and the ID tokens.
Reads the key-encryption inputs from configuration (authserver.keys.encryption.password and authserver.keys.encryption.salt, taken from the environment in production).
Inputs of the encryption of private signing keys at rest.
Supplies the inputs of the encryption of signing keys at rest to a test context.
Runs the keytool of the JDK that runs the tests and cleans up the temporary directories its key stores live in; the JDK has no public API to issue a certificate.
Thrown when removing a sign-in method would leave the account with none, so its owner could never sign in again.
The result of a granted legacy implicit request: the access token and what the response needs to send it to the client in the fragment of its redirect URI.
Grants the legacy implicit request: after checking the client, its redirect URI, the user, the multi-factor policy, the state and the scopes, it issues an access token (never a refresh token) through the token generator, stores the authorization (so the token can be introspected and revoked) and returns it for the response handler.
Reads an authorization request with response_type=token.
An authorization request of the legacy implicit flow (response_type=token), not yet authenticated: the request as the client sent it and the user the request arrived with.
Registers the one client of the legacy implicit flow at start-up, when it does not exist yet: public, grant implicit only (no refresh token, no consent), one redirect URI, a restricted scope and audience and the lifetime of the flow.
Enables the legacy implicit flow.
The result of a legacy implicit request that was refused after its redirect URI had been checked, so the refusal is sent to the client in the fragment of the redirect URI.
Settings of the legacy implicit flow, bound from authserver.legacy-implicit.* (see application-legacy-implicit.yml).
Adds the legacy implicit flow to the authorization endpoint: its converter first, its provider first and its response handler in place of the framework's (which it delegates to for an authorization code).
Answers the authorization endpoint: for the two results of the legacy implicit flow it redirects with 302 to the registered redirect URI and carries the token, or the error, in its fragment (so it never reaches a server log as a query would); any other result is the framework's authorization code response and goes to the delegate.
Builds the token generator of the legacy flow with the claims customizers of the server, so its tokens carry the same roles, tenant, audience and authentication claims as those of the other flows.
PhoneCountryResolver over libphonenumber: the region of an E.164 number.
PhoneNormalizer backed by Google libphonenumber: accepts only valid numbers and never throws.
Use case that links an identity of an external provider to the account of a signed-in user.
The user name a magic link token is stored with.
Use case that lists the client certificates bound to an account.
Use case that lists every registered client.
Use case that lists the documents a user may see, on behalf of that user (token exchange).
Use case that lists the documents of the signed-in user.
Use case that lists documents: those of one owner, or all of them.
Use case that lists the documents the service client may see with its own (client credentials) token.
Use case that lists the identities of external providers linked to an account.
Use case that lists the passkeys of a user.
Use case that lists every stored signing key, whatever its state, for administration.
Use case that lists the trusted devices of a user that have not expired.
Use case that locks the sign-in methods of an account for the rest of the caller's transaction and counts them: a password its owner knows (not a generated one), the linked identities, a passkey and the bound certificates.
Default SmsSender: sends nothing, it records the message in the SmsOutbox and logs the masked recipient.
 
Extension point that lets an authentication method customize the login/UI security filter chain.
Builds the content security policy of the server-rendered pages from the BrandingProperties: same-origin resources only and no framing, except that images may also be data: URIs (the QR code of an authenticator app, rendered in memory so its secret never becomes a resource of its own) and, when the branding logo is an absolute http(s) URL, come from its origin (img-src 'self' data: <scheme://host[:port]>).
Serves the login page, as the contract apis/auth-server/web-pages/auth-server-pages-v1.yaml describes it through the generated LoginPageApi, supplying the ordered login method fragments and the outcome of the last attempt to the template.
Maps the exception of a failed sign-in, which Spring Security keeps in the SPRING_SECURITY_LAST_EXCEPTION session attribute, to the key of the message the login page shows.
Adds the security headers of the server-rendered pages: the content security policy that LoginContentSecurityPolicy builds (same-origin resources only, no framing, and the origin of an absolute branding logo URL for images), X-Content-Type-Options and Referrer-Policy.
Extension point that lets an authentication method contribute a Thymeleaf fragment to the login page.
 
Permits the stylesheet shared by the server-rendered pages, which must load before anybody has signed in.
Configures how a user signs out of the login/UI chain: a POST to "/logout" (protected by CSRF, so a third-party page cannot sign the user out) invalidates the session, deletes its cookie and returns to the login page.
Wires the OpenID Connect RP-initiated logout of the BFF.
Serves the page that asks the user to confirm signing out, as the contract apis/auth-server/web-pages/auth-server-pages-v1.yaml describes it through the generated LogoutPageApi.
 
Wires the SMTP implementation of AccountMailer.
Describes the Mailpit container the one-time token tests read the e-mail of: the pinned image, its two ports and a factory that builds the container and the client of its HTTP API.
Reads the messages a Mailpit server received through its HTTP API, so a test finds the code or the link the application mailed to a recipient.
A message Mailpit received.
Starts a Mailpit container for a Spring test context and points the application's mail sender at it, so the messages the application sends can be read back through MailpitClient.
Settings of the e-mails sent by SmtpAccountMailer.
Decides whether an authentication has presented enough factors for the request being served: when the client or the user requires multi-factor authentication, the factors must satisfy the MfaPolicy; otherwise any authentication does.
Adds to the access and ID tokens how the user authenticated: amr (the RFC 8176 values of the factors really presented, plus mfa when there are at least two), acr (the class of the authentication, see AuthenticationContextClass) and auth_time (the epoch second the primary factor was presented, a number per OIDC; access tokens only, because the framework sets it on ID tokens).
Wires multi-factor authentication: Spring Security's multi-factor support (it enables the entry points for a missing factor authority; the factors are not required globally, because the MfaAuthorizationManager requires them only when the client or the user asks for it), the registry of AuthenticationFactor beans, the policy manager, and its application to the login chain and to /oauth2/authorize.
Exposes the domain collaborators of the multi-factor use cases as beans, so no use case creates them and a deployment (or a test) can replace any of them, and binds the MfaProperties.
Translates the failures of the authenticator app, recovery code and trusted device endpoints to RFC 9457 problem details, answered as application/problem+json.
Applies the multi-factor policy to the login/UI chain: the consent page needs the factors the policy asks for, and a user who lacks a registered second factor is sent to the second-factor page instead of getting a 403.
The rule that decides when the factors of an authentication are enough, and when they are required.
Multi-factor settings, bound once from authserver.mfa.* and injected wherever one of them is needed (the use cases of this module and the step-up guard of the API).
Applies the multi-factor policy to /oauth2/authorize: a user whose client or account requires a second factor and has not presented one is sent to the second-factor page, with the authorize request saved, before any code is issued.
Stops the startup when no SMS gateway is configured: none of the profiles that provide an SmsSender (twilio, sns, or dev / test for the logging one) is active.
Builds the mtls_endpoint_aliases metadata claim of RFC 8705 (section 5): the addresses of the endpoints that authenticate clients on the dedicated TLS port, the issuer's host with authserver.x509.port.
Configuration of the mutual-TLS client authentication (authserver.mtls.*, RFC 8705).
The certificate authorities trusted for tls_client_auth, loaded once at startup.
Issues and verifies purpose-bound tokens as JWTs signed with the active signing key and verified against the published keys.
The OAuth2 client of the service client: its registrations, the authorized client manager that caches the access tokens and renews them shortly before they expire, and the documents client that sends them.
Port to the documents on the resource server, read on behalf of a user: the subject token of the user is exchanged for a token for the resource server (RFC 8693).
Builds the documents client of a user: its requests carry the access token that the authorization server issues in exchange for the user's own token.
A numeric one-time code that was issued to a user.
Port that generates the numeric codes users type.
Port that hashes one-time codes so that only the hash is stored.
Port that stores the numeric one-time codes.
Outcome of a request for a one-time code.
Maps a row of the ott_codes table to a OneTimeCode.
 
Registers Spring Security's JDBC one-time token service, which stores the magic link tokens in the one_time_tokens table instead of in memory.
Runtime OpenAPI documents of the authorization server, served by springdoc.
Runtime OpenAPI document of the JSON API of the BFF, served by springdoc at "/v3/api-docs" to a signed-in user.
Runtime OpenAPI document of the HTTP API of the resource server, served by springdoc at "/v3/api-docs".
Compares an OpenAPI contract under apis/ with the OpenAPI document a running application serves.
Reads what is posted to POST /login/ott: the token field holds either the token of a magic link (a UUID, which OttLinkAuthenticationProvider consumes) or the numeric code of an e-mail or SMS, which is tied to the identifier and the binding id the session of the browser holds.
Sends the browser back after a failed submission to POST /login/ott: a wrong numeric code goes to the page where it is typed (/login/ott?error), so the user can try again, and a magic link that is not valid goes to the sign-in page (/login?error).
Forgets the pending token of the session once it was used, then lets the delegate resume the request the sign-in interrupted.
Adds the one-time token methods to the login/UI chain through http.oneTimeTokenLogin(...): the request of a token (POST /ott/generate), the submission of a magic link token or a numeric code (POST /login/ott) and, as a second factor, the submission of a code (POST /login/second-factor/ott).
Hands the session authentication strategy of the chain to the second-factor filter.
Channel through which a one-time token reaches the user.
Scheduled entry point that deletes what one-time tokens leave behind once it expired: the numeric codes, the pending phone verifications, the SMS cost ledger entries past their retention and Spring's expired link tokens.
Number of rows removed by a cleanup run.
Signs a user in with a numeric one-time code, delivered by e-mail or SMS, through VerifyOneTimeCodeUseCase.
Request to sign in with a numeric one-time code: the code the user typed, the identifier it was requested for and the binding id of the session that requested it.
Wires the one-time token methods into the login/UI chain.
Declares the collaborators of the one-time-code use cases as beans, so they can be replaced and mocked.
Port that delivers a one-time token to a destination through a channel.
Thrown when a one-time token could not be delivered.
Delivers the one-time tokens the use cases asked for, once the transaction that stored them has committed (TransactionPhase.AFTER_COMMIT; an event published outside a transaction is delivered at once) and off the request thread (@Async, on Spring Boot's applicationTaskExecutor).
Where a one-time code of a user is delivered.
Translates the failures of the phone endpoints to RFC 9457 problem details, answered as application/problem+json.
Registers the one-time token methods as authentication factors.
Resolves the request of POST /ott/generate to the token Spring's filter asks the token service for.
What a request to POST /ott/generate asks for, read from its form fields: through which channel, a numeric code or a magic link, and for a sign-in or as a second factor.
Delivers the token Spring's filter just generated, and answers every request the same way.
Shape of a one-time token.
Confirms a magic link: consumes the token Spring's JdbcOneTimeTokenService stored and signs the user in with it.
Builds the magic link of a token.
Contributes the one-time token sign-in to the login page: a form that asks for the identifier and whether to receive a code or a magic link by e-mail, or a code by SMS, and posts it to POST /ott/generate.
Serves the two pages of the one-time token flow, as the contract apis/auth-server/web-pages/ auth-server-pages-v1.yaml describes them through the generated OneTimeTokenPageApi: the page where the code is entered (or that says to check the inbox when a magic link was requested) and the page a magic link opens, whose button posts the token.
The rules of one-time tokens: how long each kind lives, how long a code is and how many wrong submissions are tolerated.
Settings of the one-time codes, bound from authserver.ott.* once and validated at startup.
The authentication providers of the one-time token methods, held together.
What a one-time token is used for.
Rate limiter of the one-time token endpoints, on the pattern of the account endpoints' limiter: Bucket4j token buckets in Caffeine caches (FixedWindowBuckets).
A client address or an identifier requested or submitted more one-time tokens than its window allows.
Applies OttRateLimiter to the one-time token endpoints, which are Spring Security filters (so no controller advice sees their failures): POST /ott/generate counts as a token request and POST /login/ott and POST /login/second-factor/ott as submissions, each per client address and per identifier.
Configuration of the rate limiting of the one-time token endpoints (authserver.ott.rate-limit.*): the requests for a token (POST /ott/generate, the phone enrolment) and the submissions of a token or a code (POST /login/ott, POST /login/second-factor/ott, the phone verification).
Verifies a numeric one-time code, delivered by e-mail or SMS, as the second factor of the signed-in user through VerifyOneTimeCodeUseCase, which counts the failures against the second-factor lockout, locks after too many, clears the counter on success and records the security events: a locked second factor is rejected even for a correct code.
Decides through which channels a one-time code or link may be the second factor of a signed-in user.
Processes the post of the one-time code form of the second factor (POST /login/second-factor/ott), in the way TotpAuthenticationFilter processes the TOTP forms.
Contributes the one-time token second factor to the second-factor page: the buttons that send a code or a magic link by e-mail and a code by SMS to the signed-in user, each posting to POST /ott/generate with the second-factor purpose.
Request to verify a one-time code as a second factor: the authentication the user already holds (the primary factor), the code the user typed and the binding id of the session that requested it.
Outcome of the verification of a one-time code.
What happened when a code was verified.
Renders a server-rendered page (a Thymeleaf template) to the text/html answer of an operation generated from the pages contract.
Enables pushed authorization requests (RFC 9126) when authserver.par.enabled is true: a client authenticates at POST /oauth2/par, receives a one-time request_uri and then sends the user to the authorization endpoint with it.
A WebAuthn credential registered by the account
A passkey (WebAuthn credential) registered by a user.
Customizes the login/UI chain with the passkeys (WebAuthn).
Installs the passkeys (WebAuthn) in the login/UI chain.
Manages the passkeys of the authenticated account (the operations of the contract).
Maps the passkeys of the domain onto the DTO generated from the contract.
Answers the failures of the passkeys API as application/problem+json.
Registers a passkey (WebAuthn credential) as an authentication factor: a strong primary one, because the authenticator proves possession of the key and, with user verification, the user as well, so it satisfies the multi-factor policy on its own.
Contributes the passkey sign-in to the login page: a button and a field the browser fills with the passkeys it knows (conditional mediation).
Thrown when a user has no passkey with the requested identifier.
Relying party settings of the passkeys (WebAuthn), bound once from authserver.passkeys.* and injected wherever one of them is needed.
Lets a request to the registration endpoints of the WebAuthn filters (/webauthn/register and everything below it) through only when the session satisfies the multi-factor policy of its account.
The authorization filter that guards the registration endpoints of the WebAuthn filters.
Port that reads and manages the passkeys users registered.
Maps a row of the user_credentials table to a Passkey.
 
Contributes the "use a passkey" action to the second-factor page.
Applies the second-factor lockout to a passkey that completes a second-factor step.
 
Renders the account page where the signed-in user registers passkeys.
What the passkeys page shows of a passkey.
Maps the passkeys of the domain onto the view model of the passkeys page.
Declares the authentication provider of the password-based sign-in, instead of the one Spring Security builds from the UserDetailsService bean, to close a user enumeration.
Registers the password encoder of the password-based sign-in and of the client secrets: new values are encoded with Argon2, while bcrypt and PBKDF2 hashes stay verifiable (and are upgraded on the next successful sign-in).
Registers the password as an authentication factor: a primary one, which needs a second factor to satisfy the policy.
Port that hashes and checks passwords.
Contributes the username and password form to the login page, as every authentication method does through the LoginMethodFragment extension point.
Password rules in the style of NIST SP 800-63B: a minimum and a maximum length, no composition rules (no required digits, symbols or upper-case letters) and a password that does not contain the username.
Exposes the domain's PasswordPolicy as a bean, so the use cases that check a new password depend on the policy instead of creating it, and a deployment can replace it with a policy of its own.
Request of a password reset link
A rule of the PasswordPolicy that a candidate password breaks.
Reads the certificate sent to bind it to an account: exactly one X.509 certificate in PEM form, within its validity period, with a subject.
The marker a signed-in user leaves in the session when asking to link an identity of an external provider: the next sign-in with that provider, before the marker expires, links the identity to this account instead of signing anybody in.
Keeps the link marker (PendingIdentityLink) of the explicit link flow: the identities page records it in the session before sending the browser to the provider, and the user services consume it when the provider sends the user back.
The one-time token a browser has asked for and not used yet, kept in its session: for whom, through which channel, of which kind and for what purpose, and the binding id the numeric code was stored with.
Keeps, in the session, the recovery codes generated when an authenticator app is enrolled during the sign-in, from the post that confirms it until the page that shows them once (RecoveryCodesPageController), which takes them out of the session.
 
Shows, enrols, verifies and removes the phone number of the authenticated account, the number the SMS codes go to.
Port that tells the country of a phone number.
Maps the results of the phone use cases onto the DTOs generated from the contract.
Confirmation that a verification code was requested
Outcome of starting a phone enrolment.
Port that turns the phone number a user typed into E.164.
The account has no verified phone number.
A phone number in E.164 format.
 
Keeps the phone page and its form posts behind the multi-factor policy, as the passkeys page is: a session that only presented the password of an account that still has to complete its second factor is sent to the second-factor page instead of being able to change the phone that receives the codes.
Serves the phone account page and the session-protected form posts it uses, as the contract apis/auth-server/web-pages/auth-server-pages-v1.yaml describes them through the generated PhonePageApi.
The verified phone number of the account
The step-up rule of StepUpGuard for a browser session instead of a bearer token: while the account has a confirmed second factor, a sensitive change (removing the phone) needs a session that shows a multi-factor sign-in made within authserver.mfa.step-up-max-age; an account without a second factor cannot step up, so it is not asked to.
A pending verification of a phone number: the code that was sent to it, hashed, until the user types it.
Port that stores the pending phone verification of each user, with the code hashed.
Maps the pending_* columns of a row of the user_phones table to a PhoneVerification.
What one poll of the token endpoint answered (RFC 8628 section 3.5).
Any other error (access_denied, expired_token, ...): the flow is over.
The user approved the request.
authorization_pending: the user has not decided yet; poll again after the same interval.
slow_down: polling too fast; the interval grows by DeviceFlowCli.SLOW_DOWN_INCREMENT_SECONDS.
Meta-annotation for integration tests backed by a PostgreSQL Testcontainers container.
Exposes a PostgreSQL Testcontainers container as a Spring Boot service connection, so the DataSource (and Flyway) of a test context is wired to it automatically.
Argument checks shared by the domain models.
What a binding keeps of a certificate sent to the account API: its fingerprint, which identifies it, and its subject, which only tells the bindings apart.
Rules about the session a one-time token is used as a second factor in: it must already hold a primary factor, and the second factor must not be the very channel that signed the user in (an e-mail code after an e-mail sign-in would prove the same mailbox twice).
Builds the principals the authorized client manager caches tokens under.
Resolves the key that signs the private_key_jwt assertion: the unencrypted PKCS#8 PEM RSA private key of ServiceClientKeyProperties, with its public half derived from it and the RS256 algorithm.
RFC 9457 problem details.
RFC 9457 problem details of a failed call to the documents, answered as application/problem+json.
Base of the exception handlers of the REST API: every problem detail is answered as application/problem+json (RFC 9457), as the contracts under apis/ declare.
Extension point that lets a feature customize the OAuth 2.1 / OpenID Connect protocol endpoints, for example to add an authentication provider or a converter to the token endpoint.
How far a provider's own multi-factor authentication is trusted.
Use case that finds the keys to publish in the JWKS: the active key, the next key (so relying parties can cache it before it signs) and every retired key whose tokens may still be unexpired.
Deletes the identifiers of the client assertions that already expired.
Derives, from the key-encryption secret (KeyEncryptionProperties), a distinct salt and key for each purpose other than the encryption of signing keys, so no two uses share a key: a key exposed or misused for one purpose says nothing about the others.
Renders a text as a QR code, as a PNG image in a data: URI an authenticator app enrolment page can show without another request.
Forces a new sign-in: it discards the stale authentication of the session (the security context of the thread and the one stored by the repository), saves the request being served (typically /oauth2/authorize?...) so it resumes once the user has signed in again, and redirects to the login page.
Raised when an authorization request asks (through max_age) for a more recent authentication than the session has.
Use case that records a security event (login, second factor, lockout, trusted device) in the audit log.
A single-use code that replaces the second factor when the authenticator is lost.
Generates a new set of recovery codes for the authenticated account.
Port that stores the recovery codes of each user.
Maps a row of the recovery_codes table to a RecoveryCode.
Creates recovery codes (Crockford base-32 alphabet, so no I, L, O or U) and normalizes what a user types back into that form.
 
 
Serves the page that shows, once, the recovery codes generated when an authenticator app was enrolled during the sign-in, as the contract apis/auth-server/web-pages/auth-server-pages-v1.yaml describes it through the generated RecoveryCodesPageApi.
A set of recovery codes, shown only once
Success handler of the second-factor post: when the post confirmed an enrolment and recovery codes are waiting to be shown, the browser goes to the page that shows them once (whose "Continue" button resumes the interrupted request); otherwise the delegate resumes the interrupted request straight away.
Adds the claims of IssuedTokenClaims to the reference (opaque) access tokens.
Use case that registers an account.
Records the use of a client assertion and tells whether it is a replay.
Maps the domain ClientRegistration onto Spring Authorization Server's RegisteredClient and back.
SignedTokenLifetimes over the registered clients: the longest of the ID-token lifetime and the access-token lifetimes of the clients that receive self-contained (signed) access tokens.
Creates the decoder of the client assertions of a client.
Registration of a new account
Use case that counts a failed second-factor attempt and locks the second factor of the user once authserver.mfa.max-failed-attempts consecutive failures are reached.
Removes the phone of a user, verified and pending.
The new label of a passkey
Use case that renames a passkey of a user.
Validates what the framework's default assertion validators leave out: the assertion must carry a jti, an iat no later than now (within the same clock skew the framework's timestamp validator allows) and an exp no more than the configured maximum lifetime after it, so a future iat cannot stretch the window, and its jti must not have been used before by the same client (RFC 7523, section 3).
Sends a magic link to the verified e-mail address of an enabled account.
Sends a one-time code to a user, by e-mail or SMS.
Use case that starts a password reset.
Reset of a forgotten password with the token received by e-mail
Use case that chooses a new password with the single-use token received by e-mail.
Use case that clears the failed second-factor attempts of a user, after a successful verification.
Use case that resolves a client certificate, presented over TLS or by a trusted proxy, to the account it is bound to.
Use case that resolves a sign-in with an external provider to a local account.
Finds where a one-time code of a user may be delivered: the verified e-mail address or the verified phone of an enabled account.
Entry point of the resource-server application.
Builds the client of the resource server: the RestClient that carries the access token of the signed-in user, and the DocumentsApi generated from the resource server's contract on top of it.
Creates the interceptors that put the access token on the calls to the resource server: Spring Security's OAuth2ClientHttpRequestInterceptor (bearer), or the DPoP one when service-client.auth.dpop is on.
Where the resource server is (bff.resource-server.*).
Where the resource server is.
Implements the documents port with the client generated from the resource server's contract.
Documents of the resource server read with the service client's own token (client credentials grant).
Documents of the resource server read on behalf of a user: the user's access token is exchanged (RFC 8693) for one of the service client, which names the user as subject and the client as actor.
Sends the browser, once the OAuth2 login has succeeded, back to the returnTo that BffLoginController validated and kept in the session.
Decides whether a returnTo value asked by the browser is a safe place to send it back to after the login.
Decorator of an OAuth2AuthorizationService that detects the reuse of rotated refresh tokens.
Use case that revokes a trusted device of a user, so it asks for the second factor again.
Use case that revokes every token of a user, for example after a password change or reset.
 
 
 
Adds the claims of IssuedTokenClaims to the self-contained tokens (JWT access tokens and ID tokens): the roles, tenant and aud claims of an access token, then the claims of every JwtClaimsContributor, which also reach the ID tokens.
Use case that replaces the secret of a client that authenticates with a client secret with a new generated one.
Use case that keeps the signing keys rotating.
Generates RSA signing keys for the RS256 algorithm.
Enables scheduled tasks for every feature of the application (key rotation, clean-up of expired authorizations and account tokens, ...).
Port that keeps the failed second-factor attempts of each user, so that a lockout survives restarts and is shared by every instance of the server.
Serves the second-factor page, as the contract apis/auth-server/web-pages/auth-server-pages-v1.yaml describes it through the generated SecondFactorPageApi, supplying the ordered fragments of the second factors, the model attributes each of them contributes for the signed-in user and the outcome of the last attempt to the template.
Extension point that tells whether a user has confirmed one kind of second factor.
Error handler of the authorization endpoint: a SecondFactorRequiredException goes to the entry point of the second-factor page, a ReauthenticationRequiredException to the one that forces a new sign-in, and any other error is answered as Spring Authorization Server's own handler does (a redirect to the client's redirect URI carrying the error, or a 400 when there is none).
Extension point that lets a second factor contribute a Thymeleaf fragment to the second-factor page.
Thrown when a second factor is attempted while the user's second factor is locked after too many failures.
The failed-attempt state of the second factor of one user.
Maps a row of the second_factor_attempts table to a SecondFactorLockout.
 
Sends a user who has presented a primary factor but not yet the second one to the second-factor page, after saving the request being served (typically /oauth2/authorize?...) so the sign-in resumes where it left off once the second factor is verified.
Raised while an authorization request is validated when the user must present a second factor first.
Resolves the identifier of the account of a signed-in user.
Port that creates the shared secrets of TOTP credentials.
Generates numeric one-time codes with a cryptographically strong random number generator.
Creates 160-bit secrets, the length RFC 4226 recommends for HMAC-SHA1, from a SecureRandom.
TokenGenerator that creates tokens from a SecureRandom and hashes them with SHA-256.
Security filter chains of the authorization server: the protocol endpoints chain and the login/UI chain.
Signs users in with OAuth2 / OpenID Connect login and out with the RP-initiated logout of the authorization server.
Secures the API: every request except the health endpoint and the OpenAPI document requires a valid bearer token issued by the authorization server for this resource server's audience.
An authentication event kept for audit.
Records the authentications of users as security events: a success as SecurityEventType.LOGIN_SUCCESS and a failure as SecurityEventType.LOGIN_FAILURE.
Port that stores the audit trail of authentication events.
Maps a row of the security_events table to a SecurityEvent.
Kinds of authentication events that are recorded for audit.
Use case that registers the configured clients (built from DefaultClientDefinitions) that are missing.
Outcome of seeding the default clients.
Requests an SMS inside the cost policy: the country must be served and the spending of the window and of the day, including this message, must stay within their caps.
A text message recorded by the SmsOutbox.
Representing a Server configuration.
Representing a Server configuration.
Representing a Server configuration.
Representing a Server Variable for server URL template substitution.
Representing a Server Variable for server URL template substitution.
Representing a Server Variable for server URL template substitution.
Entry point of the service-client application.
Settings of the service client at the authorization server (service-client.auth.*).
Private key with which the private_key_jwt assertion is signed (service-client.auth.key.*): an unencrypted RSA key in PKCS#8 PEM, given inline (the CLI profiles read it from the SERVICE_CLIENT_PRIVATE_KEY environment variable) or as the path of a file.
Builds the OAuth2 client registrations of the service client from its settings: one for the client credentials grant and one for the token exchange grant, which share the client's identity and authentication.
Gives the access token the service client uses, for the CLI that is asked to print it.
Names the cookie of the HTTP session of the BFF with the __Host- prefix.
Hands the session authentication strategy of the chain to the WebAuthn filter.
Maps the OpenID Connect user of the BFF session onto the DTO generated from the contract.
The user signed in to the BFF session
Hashes one-time codes with SHA-256 (lower-case hex) and compares them in constant time.
Port that tells how long the tokens signed with the signing keys stay valid, so that a retired key stays published for as long as any token it signed can still be presented.
Port that issues and verifies signed, purpose-bound tokens.
An asymmetric key pair used to sign tokens.
Administration of the signing keys, as the contract apis/auth-server/rest-server/auth-server-api-v1.yaml describes it through the generated SigningKeysApi.
Creates the first active and next keys at startup, so the server can sign tokens before the first scheduled rotation.
Maps the signing keys of the domain onto the DTO generated from the contract, so a domain model is never returned from SigningKeyAdminController.
Port that generates new signing keys.
Maps the domain SigningKey onto Nimbus JSON Web Keys: the public set lists the public half of every key it is given, whereas the signing set holds the single active key with its private half, decrypted with the AesGcmKeyCipher.
Port that stores signing keys.
A signing key, without its private half
Decides how long a retired signing key stays published.
Periodically applies the key lifecycle.
Runs the key lifecycle and announces it, so every caller (the endpoint, the scheduled job and the startup bootstrap) gets the same cache refresh without depending on the adapter that holds the caches.
Maps a row of the signing_keys table to a SigningKey.
 
Published after the signing keys have been rotated, so adapters that cache keys can drop what they hold.
Lifecycle state of a signing key.
Base of the exception handlers of the APIs that remove a sign-in method of the account (the linked identities, the bound certificates): both refuse to remove the last way to sign in and both need a recent multi-factor sign-in, so both answer those failures the same way.
The ways an account can sign in with.
Port that serializes the removals of the sign-in methods of one account (unlinking an identity, unbinding a certificate), so that two concurrent removals cannot each count the other's method as remaining and together leave the account with no way to sign in.
Waits between two polls of the token endpoint.
Wires the phone normaliser and the logging SmsSender of development and tests.
Thrown when an SMS is not sent because it would exceed the spending cap of the window or of the day.
Declares the policy of the SMS channel as a bean.
Port that keeps the ledger of what text messages cost, in the database so that a restart cannot reset a budget.
The rules that keep text messages from costing too much: the countries messages may go to, what a message costs in each and the budget per window and per day.
Thrown when an SMS is not sent because its country is not served, or cannot be determined.
Thrown when a text message could not be sent.
Port that lists the messages a development sender recorded instead of sending them.
A text message a development sender recorded instead of sending it, as the development inbox shows it.
A text message to send.
Texts of the SMS messages.
Bounded, thread-safe, in-memory record of the messages the LoggingSmsSender "sent", so the development inbox can show them, which reads it through the domain port SmsInbox.
Settings of the SmsOutbox.
Settings of the SMS channel, bound from authserver.sms.* once and validated at startup.
Base of the reasons why an SMS is refused before it is sent.
Event published when a text message, whose cost is already recorded within the budget, must be sent.
Port that sends a text message through a gateway.
A spending cap of text messages: what may be spent in a window that ends at the message being sent.
AccountMailer that sends plain-text messages through SMTP.
Wires the Amazon SNS sender when the sns profile is active.
SmsSender that publishes directly to a phone number through Amazon SNS.
Customizes the login/UI chain with the sign-in with external providers: http.oauth2Login(...) with the client registrations of the configured providers, the user services that resolve the local account, the success handler that grants the federated factor and, for Apple, the signed client secret and the form post callback.
Installs the sign-in with external providers in the login/UI chain.
Exposes the domain's FederatedLinkingPolicy as a bean, so the use cases of social login depend on the policy instead of creating it, and a deployment can replace it with a policy of its own.
Declares the generator of the Apple client secret, only while Apple is configured.
Contributes the sign-in with the configured external providers to the login page: one link per enabled provider, below the password form and the passkeys.
Settings of the sign-in with external providers, bound once from authserver.social.* and injected wherever one is needed; an invalid value stops the application at startup.
Settings of one provider.
Condition that holds when at least one social provider is configured, that is, when some authserver.social.providers.<id>.client-id has text.
Adapter of the CompromisedPasswordCheck port over Spring Security's CompromisedPasswordChecker (in production, the Have I Been Pwned range API, which only receives a hash prefix of the password).
Adapter of the PasswordHasher port over Spring Security's PasswordEncoder.
Builds the HTTP request factory that presents the client certificate: the one of the SSL bundle named by service-client.auth.ssl-bundle.
The phone number to enrol
Starts the enrolment of a phone: normalises the number and sends it a verification code.
Answers a StepUpRequiredDecision with 401 and the RFC 9470 challenge (error="insufficient_user_authentication" with the required acr_values and max_age); every other denial goes to the delegate, the RFC 6750 handler.
Requires that the bearer token proves a recent strong authentication (RFC 9470): its acr claim must be one of the configured (space-separated) values and its auth_time claim no older than the configured maximum age.
Applies the OpenID Connect step-up parameters of an authorization request to the authentication of the session.
Adds the step-up values that BffLoginController kept in the session to the authorization request built by the delegate, as the OpenID Connect acr_values and max_age parameters, and forgets them, so they apply to one login only.
Maps the WWW-Authenticate challenge of a 401 answer of the resource server onto the domain: a bearer challenge with error="insufficient_user_authentication" (RFC 9470) becomes a DocumentsStepUpRequiredException carrying its acr_values and max_age.
Guards the API operations that remove or reset a second factor (disabling the authenticator app, generating new recovery codes, revoking a trusted device): a stolen token, or a session left open, must not be enough to weaken the account.
Step-up values of a login (RFC 9470), kept in the session by BffLoginController until StepUpAuthorizationRequestResolver adds them to the authorization request.
Maps a step-up request of the resource server onto the extra members of the step-up-required problem, the values the SPA passes back to GET /bff/login.
Step-up authentication policy (RFC 9470) of the sensitive operations, bound from resourceserver.step-up.*.
Applies step-up authentication (acr_values and max_age) to /oauth2/authorize.
Denial that tells StepUpAccessDeniedHandler the caller is allowed to perform the operation but must authenticate again more strongly or more recently (RFC 9470), as opposed to an ordinary refusal.
 
 
 
The user a token exchange acts for: the principal is the user's access token, which is what Spring Security's token exchange provider reads as the subject token, and the name is what the authorized clients are cached under.
Generates self-signed client certificates at run time for the tests of the sign-in with a client certificate, so no certificate, key or key store is ever kept in the repository.
A generated certificate.
A small public key infrastructure generated at run time for the tests of TLS client authentication: a certificate authority, and server and client certificates it signs, each kept in a PKCS#12 key store inside one temporary directory that TestPki.close() deletes.
An identity of the infrastructure.
OttDelivery that e-mails one-time codes and magic links as multipart messages (plain text and HTML) rendered with Thymeleaf.
Builds the clients of the token endpoint for the two grants, set up for the configured authentication method: the default for client_secret_basic; the signed assertion for private_key_jwt; a REST client over the SSL bundle (so the client certificate is presented) for the mutual TLS methods; plus a DPoP proof header when DPoP is enabled.
Honours the audience parameter of a token exchange request, which the framework parses but ignores.
Command-line client of the OAuth 2.0 token exchange grant (RFC 8693): exchanges the access token of a user, read from the SERVICE_CLIENT_SUBJECT_TOKEN environment variable, for one that names the user as subject and this client as actor, lists the documents the resource server shows that user and prints each one as a JSON line.
Port that creates random opaque tokens and hashes them for storage.
Successful response of the token endpoint (RFC 6749 section 5.1).
The time-based one-time password algorithm of RFC 6238 over HMAC-SHA1, with the parameters every authenticator application supports: 30 second steps and 6 digits.
Thrown when a user who already confirmed an authenticator app tries to enrol another one.
 
Processes the post of the second-factor forms (POST /login/second-factor/totp): the TOTP form, the recovery-code form and the enrolment form (field enroll) of a user who has no authenticator app yet.
Verifies a TOTP code or a recovery code for the signed-in user, or the first code of an authenticator app being enrolled during the sign-in, which confirms it, through the TotpCodeVerifier.
Request to verify a second factor: the authentication the user already holds (the primary factor) and the code the user typed, and what kind of code it is.
Adds the TOTP second factor to the login/UI chain: the second-factor page and the post of its forms are open to a user who has signed in with a password (and only to such a user), and the filters that verify the code and recognise a trusted device are installed before the authorization check.
Hands the session authentication strategy of the chain to the TOTP filter.
What the code posted to the TOTP filter is.
Sends a posted code to the use case of its kind (TotpCodeKind): a TOTP code, a recovery code, or the first code of an authenticator app enrolled during the sign-in.
Wires the TOTP second factor into the login/UI chain.
Enrols, confirms and disables the authenticator app of the authenticated account.
The TOTP credential of one user.
Port that stores the TOTP credential of each user.
Maps a row of the totp_credentials table to a TotpCredential.
Maps the results of the authenticator app and recovery code use cases onto the DTOs generated from the contract.
The secret of a pending authenticator app enrolment, as a URI and as a QR code
Registers the time-based one-time password (and the recovery codes that stand in for it) as an authentication factor: a second one, which only counts once a primary factor has been presented.
Thrown when a user has no authenticator app being enrolled, so there is nothing to confirm.
Contributes the TOTP forms to the second-factor page, as every second factor does through the SecondFactorFragment extension point.
Port that protects TOTP secrets at rest.
Builds the otpauth:// URI that authenticator applications read from a QR code to enrol a secret.
Reads the PEM files of the trusted certificate authorities into trust anchors.
A browser that a user chose to trust, which lets it skip the second factor (never the first) until it expires.
Lists and revokes the trusted devices of the authenticated account.
Writes the cookie that identifies a trusted device.
Maps the trusted devices of the domain onto the DTO generated from the contract, so a domain model is never returned from TrustedDeviceController.
Registers the trusted device as an authentication factor of strength FactorStrength.REMEMBERED: together with the password it satisfies the sign-in policy, so a trusted browser is not asked for the code again, but it is never reported in amr, acr or auth_time and never satisfies a step-up request (acr_values asking for the multi-factor class, max_age), which still needs a real second factor.
Lets a browser that was trusted earlier skip the second factor of a sign-in.
Thrown when an account has no trusted device with the requested identifier.
Port that stores the devices users trust.
A browser on which the second factor is skipped until it expires
Maps a row of trusted_devices to a TrustedDevice.
 
Creates the random tokens that identify a trusted device and hashes them, so only the SHA-256 hash is ever stored.
Port that signs the value of the trusted-device cookie and checks that signature, so a value the server did not issue is rejected before anything is looked up.
Wires the Twilio sender when the twilio profile is active (and SNS is not, so that never two SmsSender beans exist).
Thin wrapper over the Twilio SDK, so the sender can be unit-tested with a mock.
Twilio credentials and sender, bound from the environment variables AUTHSERVER_SMS_TWILIO_* only; no value is ever written in a file of this repository.
SmsSender that sends through Twilio.
Use case that unbinds a client certificate from an account and audits it.
Use case that unlinks an identity of an external provider from an account and audits it.
Use case that replaces the settings of a registered client; its secret is kept.
Use case that replaces the stored password hash of a user with one made by the current algorithm, right after a successful sign-in (the only moment the clear-text password is known).
A user that can sign in with a password.
Port that provides the user accounts able to sign in with a password.
Columns of a user row joined with its encoded password, before the authorities, which live in a table of their own, are loaded.
Maps a row of the users table joined with user_passwords to a UserAccountRow.
Spring Security UserDetailsService adapter over the FindUserAccountUseCase use case: it maps the domain UserAccount onto Spring Security's UserDetails through the UserDetailsMapper.
 
Port that removes the stored authorizations (and so the tokens) of users.
Exposes the authenticated user, as the contract apis/bff/rest-server/bff-api-v1.yaml describes it through the generated UserApi.
Maps the domain UserAccount onto Spring Security's UserDetails.
Registers the UserInfoMapper in the OpenID Connect UserInfo endpoint of the protocol chain.
Builds the OpenID Connect UserInfo response from the account of the user, limited to the granted scopes: the sub claim always; preferred_username, roles and tenant with the profile scope; email and email_verified with the email scope.
Port that stores the multi-factor settings of a user account.
The verified phone number of a user.
Port that stores the verified phone number of each user.
Maps the verified columns of a row of the user_phones table to a UserPhone.
 
Port that asks an external provider for the verified primary e-mail address of the user who just signed in, for a provider whose profile does not vouch for its e-mail address (GitHub).
Use case that confirms an e-mail address from the signed token that was mailed to it, which also enables the account.
Verifies a one-time code.
The code received by SMS
Use case that accepts a recovery code as a second factor.
Use case that verifies a TOTP code presented as a second factor: ±1 step window, no replay of a step already used, lockout after repeated failures, and an audit event either way.
Adds the module of the passkeys to the mapper of the stored authorizations.
Registers the JDBC implementations of the Spring Security WebAuthn stores.
Completes a sign-in with a client certificate.
Adds the sign-in with a client certificate to the login/UI chain through http.x509(...).
Hands the session authentication strategy of the chain to the success handler.
Installs the sign-in with a client certificate in the login/UI chain, only while authserver.x509.enabled is true.
Registers the client certificate as an authentication factor: a strong primary one, because the holder proves possession of the private key during the TLS handshake (or the proxy did on the server's behalf), so a certificate satisfies the multi-factor policy on its own.
Refuses to start when a certificate may be forwarded in a header while the server rewrites the address of its clients from the forwarded headers.
The X.509 filter of the sign-in path.
Contributes the sign-in with a client certificate to the login page: a form with one button that posts, with the CSRF token, to POST /login/x509.
Configuration of the sign-in with a client certificate (authserver.x509.*).
Adds the dedicated TLS port that requests a client certificate, when authserver.x509.port is set.
The key store that holds the server certificate of the dedicated TLS port.
Decides which key store holds the server certificate of the dedicated TLS port: the configured one or, under the dev profile and with none configured, the generated one.
Loads the account a client certificate is bound to.