Class PasskeyChainCustomizer
java.lang.Object
com.irurueta.authserver.authorization.api.web.passkeys.PasskeyChainCustomizer
- All Implemented Interfaces:
LoginChainCustomizer
Customizes the login/UI chain with the passkeys (WebAuthn).
http.webAuthn(...) adds the filters of the four framework endpoints (the authentication options, the
authentication, the registration options and the registration) and this class makes them safe for this server:
- the options and the sign-in post are public (CSRF stays on: the page script sends the token), as is the script;
- the registration endpoints (and the account page that drives them) require a session that satisfies the
multi-factor policy of its account, see
PasskeyRegistrationAuthorizationManager; - the framework's
DELETE /webauthn/register/{id}is denied, so a passkey can only be removed throughDELETE /api/account/passkeys/{id}, which asks for a recent multi-factor sign-in, and its default registration page is turned off; - the WebAuthn filter gets the chain's session strategy (new session id on sign-in) and a user service that
refuses disabled accounts. That user service is set as the chain's shared
UserDetailsService, so it is chain-wide: every configurer of the login chain that reads the shared object gets the account-status check; - a passkey that completes a second-factor step is refused while the user's second factor is locked, see
PasskeySecondFactorLockoutFilter. That filter is added beforeBasicAuthenticationFilter, the position the WebAuthn configurer gives its authentication filter later, when the chain is built; being added first, it runs first.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringPath that answers the options of an authentication ceremony.static final StringPath that verifies an authentication ceremony.private final CheckSecondFactorLockoutUseCaseTells whether the second factor of a user is locked.private final MfaAuthorizationManagerApplies the multi-factor policy.static final intOrder of the customizer: after the TOTP one.private final PasskeyPropertiesRelying party settings.static final StringPath of the browser script of the passkeys, served fromstatic/js.private final SecondFactorUserResolverResolves the account of the signed-in user, for the lockout check.private final org.springframework.security.core.userdetails.UserDetailsServiceLoads the account of the user a passkey belongs to. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcustomize(org.springframework.security.config.annotation.web.builders.HttpSecurity http) Customizes the login/UI chain.
-
Field Details
-
ORDER
public static final int ORDEROrder of the customizer: after the TOTP one.- See Also:
-
SCRIPT_PATH
Path of the browser script of the passkeys, served fromstatic/js.- See Also:
-
AUTHENTICATION_OPTIONS_PATH
Path that answers the options of an authentication ceremony.- See Also:
-
AUTHENTICATION_PATH
Path that verifies an authentication ceremony.- See Also:
-
properties
Relying party settings. -
mfaAuthorizationManager
Applies the multi-factor policy. -
userDetailsService
private final org.springframework.security.core.userdetails.UserDetailsService userDetailsServiceLoads the account of the user a passkey belongs to. -
secondFactorUserResolver
Resolves the account of the signed-in user, for the lockout check. -
checkSecondFactorLockoutUseCase
Tells whether the second factor of a user is locked.
-
-
Constructor Details
-
PasskeyChainCustomizer
public PasskeyChainCustomizer()
-
-
Method Details
-
customize
public void customize(org.springframework.security.config.annotation.web.builders.HttpSecurity http) Customizes the login/UI chain.- Specified by:
customizein interfaceLoginChainCustomizer- Parameters:
http- security builder of the chain.
-