Class OttChainCustomizer
java.lang.Object
com.irurueta.authserver.authorization.api.web.ott.OttChainCustomizer
- All Implemented Interfaces:
LoginChainCustomizer
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). The pages the user lands
on (where the code is typed, where a magic link is confirmed) are open to everybody and the second-factor post to
signed-in users only. The rate limits are applied before anything else of the one-time token flow. CSRF protection
stays on: every form carries the token. Once the chain is configured, the second-factor filter gets the chain's
session authentication strategy, the one the form login uses (a new session id and a new CSRF token on success).
Spring's own default submit page is turned off: the pages are this server's own.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final classHands the session authentication strategy of the chain to the second-factor filter. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.springframework.security.web.authentication.AuthenticationConverterReads what is posted to the sign-in endpoint.private final org.springframework.security.authentication.AuthenticationProviderSigns a user in with a numeric code.private final org.springframework.security.web.authentication.AuthenticationFailureHandlerSends the browser back after a failed sign-in.private final org.springframework.security.web.authentication.ott.OneTimeTokenGenerationSuccessHandlerDelivers the token that was generated.private final org.springframework.security.authentication.AuthenticationProviderConfirms a magic link.static final intOrder of this customizer in the login chain, after the TOTP (1) and passkey (2) ones.private final OttRateLimitFilterApplies the rate limits to the endpoints.private final org.springframework.security.web.authentication.ott.GenerateOneTimeTokenRequestResolverResolves the token Spring's filter generates.private final OttSecondFactorFilterProcesses the post of the second-factor code form.private final org.springframework.security.web.authentication.AuthenticationSuccessHandlerResumes the interrupted request after a sign-in.private final org.springframework.security.authentication.ott.OneTimeTokenServiceStore of the magic link tokens. -
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 this customizer in the login chain, after the TOTP (1) and passkey (2) ones.- See Also:
-
rateLimitFilter
Applies the rate limits to the endpoints. -
requestResolver
private final org.springframework.security.web.authentication.ott.GenerateOneTimeTokenRequestResolver requestResolverResolves the token Spring's filter generates. -
generationSuccessHandler
private final org.springframework.security.web.authentication.ott.OneTimeTokenGenerationSuccessHandler generationSuccessHandlerDelivers the token that was generated. -
tokenService
private final org.springframework.security.authentication.ott.OneTimeTokenService tokenServiceStore of the magic link tokens. -
authenticationConverter
private final org.springframework.security.web.authentication.AuthenticationConverter authenticationConverterReads what is posted to the sign-in endpoint. -
linkProvider
private final org.springframework.security.authentication.AuthenticationProvider linkProviderConfirms a magic link. -
codeProvider
private final org.springframework.security.authentication.AuthenticationProvider codeProviderSigns a user in with a numeric code. -
successHandler
private final org.springframework.security.web.authentication.AuthenticationSuccessHandler successHandlerResumes the interrupted request after a sign-in. -
failureHandler
private final org.springframework.security.web.authentication.AuthenticationFailureHandler failureHandlerSends the browser back after a failed sign-in. -
secondFactorFilter
Processes the post of the second-factor code form.
-
-
Constructor Details
-
OttChainCustomizer
public OttChainCustomizer()
-
-
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.
-