Class ServerHttpSecurity.OneTimeTokenLoginSpec
java.lang.Object
org.springframework.security.config.web.server.ServerHttpSecurity.OneTimeTokenLoginSpec
- Enclosing class:
- ServerHttpSecurity
Configures One-Time Token Login Support
- Since:
- 6.4
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionauthenticationConverter(ServerAuthenticationConverter authenticationConverter) Use thisServerAuthenticationConverterwhen converting incoming requests to anAuthentication.authenticationFailureHandler(ServerAuthenticationFailureHandler authenticationFailureHandler) Specifies theServerAuthenticationFailureHandlerto use when authentication fails.authenticationManager(ReactiveAuthenticationManager authenticationManager) SpecifiesReactiveAuthenticationManagerfor one time tokens.authenticationSuccessHandler(Consumer<List<ServerAuthenticationSuccessHandler>> handlersConsumer) Allows customizing the list ofServerAuthenticationSuccessHandler.authenticationSuccessHandler(ServerAuthenticationSuccessHandler authenticationSuccessHandler) Specifies theServerAuthenticationSuccessHandlerprotected voidconfigure(ServerHttpSecurity http) defaultSubmitPageUrl(String submitPageUrl) Sets the URL that the default submit page will be generated.loginProcessingUrl(String loginProcessingUrl) Specifies the URL to process the login request, defaults to/login/ott.securityContextRepository(ServerSecurityContextRepository securityContextRepository) TheServerSecurityContextRepositoryused to save theAuthentication.showDefaultSubmitPage(boolean show) Configures whether the default one-time token submit page should be shown.tokenGeneratingUrl(String tokenGeneratingUrl) Specifies the URL that a One-Time Token generate request will be processed.tokenGenerationSuccessHandler(ServerOneTimeTokenGenerationSuccessHandler oneTimeTokenGenerationSuccessHandler) Specifies strategy to be used to handle generated one-time tokens.tokenService(ReactiveOneTimeTokenService oneTimeTokenService) Configures theReactiveOneTimeTokenServiceused to generate and consumeOneTimeToken
- 
Constructor Details- 
OneTimeTokenLoginSpecpublic OneTimeTokenLoginSpec()
 
- 
- 
Method Details- 
configure
- 
authenticationSuccessHandlerpublic ServerHttpSecurity.OneTimeTokenLoginSpec authenticationSuccessHandler(Consumer<List<ServerAuthenticationSuccessHandler>> handlersConsumer) Allows customizing the list ofServerAuthenticationSuccessHandler. The default list contains aRedirectServerAuthenticationSuccessHandlerthat redirects to "/".- Parameters:
- handlersConsumer- the handlers consumer
- Returns:
- the ServerHttpSecurity.OneTimeTokenLoginSpecto continue configuring
 
- 
authenticationSuccessHandlerpublic ServerHttpSecurity.OneTimeTokenLoginSpec authenticationSuccessHandler(ServerAuthenticationSuccessHandler authenticationSuccessHandler) Specifies theServerAuthenticationSuccessHandler- Parameters:
- authenticationSuccessHandler- the- ServerAuthenticationSuccessHandler.
 
- 
authenticationFailureHandlerpublic ServerHttpSecurity.OneTimeTokenLoginSpec authenticationFailureHandler(ServerAuthenticationFailureHandler authenticationFailureHandler) Specifies theServerAuthenticationFailureHandlerto use when authentication fails. The default is redirecting to "/login?error" usingRedirectServerAuthenticationFailureHandler- Parameters:
- authenticationFailureHandler- the- ServerAuthenticationFailureHandlerto use when authentication fails.
 
- 
authenticationManagerpublic ServerHttpSecurity.OneTimeTokenLoginSpec authenticationManager(ReactiveAuthenticationManager authenticationManager) SpecifiesReactiveAuthenticationManagerfor one time tokens. Default implementation isOneTimeTokenReactiveAuthenticationManager- Parameters:
- authenticationManager-
 
- 
tokenServicepublic ServerHttpSecurity.OneTimeTokenLoginSpec tokenService(ReactiveOneTimeTokenService oneTimeTokenService) Configures theReactiveOneTimeTokenServiceused to generate and consumeOneTimeToken- Parameters:
- oneTimeTokenService-
 
- 
authenticationConverterpublic ServerHttpSecurity.OneTimeTokenLoginSpec authenticationConverter(ServerAuthenticationConverter authenticationConverter) Use thisServerAuthenticationConverterwhen converting incoming requests to anAuthentication. By default, theServerOneTimeTokenAuthenticationConverteris used.- Parameters:
- authenticationConverter- the- ServerAuthenticationConverterto use
 
- 
loginProcessingUrlSpecifies the URL to process the login request, defaults to/login/ott. Only POST requests are processed, for that reason make sure that you pass a valid CSRF token if CSRF protection is enabled.- Parameters:
- loginProcessingUrl-
 
- 
showDefaultSubmitPageConfigures whether the default one-time token submit page should be shown. This will prevent theOneTimeTokenSubmitPageGeneratingWebFilterto be configured.- Parameters:
- show-
 
- 
defaultSubmitPageUrlSets the URL that the default submit page will be generated. Defaults to/login/ott. If you don't want to generate the default submit page you should useshowDefaultSubmitPage(boolean). Note that this method always invokeshowDefaultSubmitPage(boolean)passingtrue.- Parameters:
- submitPageUrl-
 
- 
tokenGenerationSuccessHandlerpublic ServerHttpSecurity.OneTimeTokenLoginSpec tokenGenerationSuccessHandler(ServerOneTimeTokenGenerationSuccessHandler oneTimeTokenGenerationSuccessHandler) Specifies strategy to be used to handle generated one-time tokens.- Parameters:
- oneTimeTokenGenerationSuccessHandler-
 
- 
tokenGeneratingUrlSpecifies the URL that a One-Time Token generate request will be processed. Defaults to/ott/generate.- Parameters:
- tokenGeneratingUrl-
 
- 
securityContextRepositorypublic ServerHttpSecurity.OneTimeTokenLoginSpec securityContextRepository(ServerSecurityContextRepository securityContextRepository) TheServerSecurityContextRepositoryused to save theAuthentication. Defaults toWebSessionServerSecurityContextRepository. For theSecurityContextto be loaded on subsequent requests theReactorContextWebFiltermust be configured to be able to load the value (they are not implicitly linked).- Parameters:
- securityContextRepository- the repository to use
- Returns:
- the ServerHttpSecurity.OneTimeTokenLoginSpecto continue configuring
 
 
-