Class ServerHttpSecurity.OAuth2LoginSpec
java.lang.Object
org.springframework.security.config.web.server.ServerHttpSecurity.OAuth2LoginSpec
- Enclosing class:
- ServerHttpSecurity
-
Method Summary
Modifier and TypeMethodDescriptionand()Allows method chaining to continue configuring theServerHttpSecurityauthenticationConverter(ServerAuthenticationConverter authenticationConverter) Sets the converter to useauthenticationFailureHandler(ServerAuthenticationFailureHandler authenticationFailureHandler) TheServerAuthenticationFailureHandlerused after authentication failure.authenticationManager(ReactiveAuthenticationManager authenticationManager) Configures theReactiveAuthenticationManagerto use.authenticationMatcher(ServerWebExchangeMatcher authenticationMatcher) Sets thematcherused for determining if the request is an authentication request.authenticationSuccessHandler(ServerAuthenticationSuccessHandler authenticationSuccessHandler) TheServerAuthenticationSuccessHandlerused after authentication success.authorizationRedirectStrategy(ServerRedirectStrategy authorizationRedirectStrategy) Sets the redirect strategy for Authorization Endpoint redirect URI.authorizationRequestRepository(ServerAuthorizationRequestRepository<OAuth2AuthorizationRequest> authorizationRequestRepository) Sets the repository to use for storingOAuth2AuthorizationRequest's.authorizationRequestResolver(ServerOAuth2AuthorizationRequestResolver authorizationRequestResolver) Sets the resolver used for resolvingOAuth2AuthorizationRequest's.authorizedClientRepository(ServerOAuth2AuthorizedClientRepository authorizedClientRepository) authorizedClientService(ReactiveOAuth2AuthorizedClientService authorizedClientService) clientRegistrationRepository(ReactiveClientRegistrationRepository clientRegistrationRepository) protected voidconfigure(ServerHttpSecurity http) securityContextRepository(ServerSecurityContextRepository securityContextRepository) TheServerSecurityContextRepositoryused to save theAuthentication.
-
Method Details
-
authenticationManager
public ServerHttpSecurity.OAuth2LoginSpec authenticationManager(ReactiveAuthenticationManager authenticationManager) Configures theReactiveAuthenticationManagerto use. The default isOAuth2AuthorizationCodeReactiveAuthenticationManager- Parameters:
authenticationManager- the manager to use- Returns:
- the
ServerHttpSecurity.OAuth2LoginSpecto customize
-
securityContextRepository
public ServerHttpSecurity.OAuth2LoginSpec securityContextRepository(ServerSecurityContextRepository securityContextRepository) TheServerSecurityContextRepositoryused to save theAuthentication. Defaults toWebSessionServerSecurityContextRepository.- Parameters:
securityContextRepository- the repository to use- Returns:
- the
ServerHttpSecurity.OAuth2LoginSpecto continue configuring - Since:
- 5.2
-
authenticationSuccessHandler
public ServerHttpSecurity.OAuth2LoginSpec authenticationSuccessHandler(ServerAuthenticationSuccessHandler authenticationSuccessHandler) TheServerAuthenticationSuccessHandlerused after authentication success. Defaults toRedirectServerAuthenticationSuccessHandlerredirecting to "/".- Parameters:
authenticationSuccessHandler- the success handler to use- Returns:
- the
ServerHttpSecurity.OAuth2LoginSpecto customize - Since:
- 5.2
-
authenticationFailureHandler
public ServerHttpSecurity.OAuth2LoginSpec authenticationFailureHandler(ServerAuthenticationFailureHandler authenticationFailureHandler) TheServerAuthenticationFailureHandlerused after authentication failure. Defaults toRedirectServerAuthenticationFailureHandlerredirecting to "/login?error".- Parameters:
authenticationFailureHandler- the failure handler to use- Returns:
- the
ServerHttpSecurity.OAuth2LoginSpecto customize - Since:
- 5.2
-
authenticationConverter
public ServerHttpSecurity.OAuth2LoginSpec authenticationConverter(ServerAuthenticationConverter authenticationConverter) Sets the converter to use- Parameters:
authenticationConverter- the converter to use- Returns:
- the
ServerHttpSecurity.OAuth2LoginSpecto customize
-
clientRegistrationRepository
public ServerHttpSecurity.OAuth2LoginSpec clientRegistrationRepository(ReactiveClientRegistrationRepository clientRegistrationRepository) -
authorizedClientService
public ServerHttpSecurity.OAuth2LoginSpec authorizedClientService(ReactiveOAuth2AuthorizedClientService authorizedClientService) -
authorizedClientRepository
public ServerHttpSecurity.OAuth2LoginSpec authorizedClientRepository(ServerOAuth2AuthorizedClientRepository authorizedClientRepository) -
authorizationRequestRepository
public ServerHttpSecurity.OAuth2LoginSpec authorizationRequestRepository(ServerAuthorizationRequestRepository<OAuth2AuthorizationRequest> authorizationRequestRepository) Sets the repository to use for storingOAuth2AuthorizationRequest's.- Parameters:
authorizationRequestRepository- the repository to use for storingOAuth2AuthorizationRequest's- Returns:
- the
ServerHttpSecurity.OAuth2LoginSpecfor further configuration - Since:
- 5.2
-
authorizationRequestResolver
public ServerHttpSecurity.OAuth2LoginSpec authorizationRequestResolver(ServerOAuth2AuthorizationRequestResolver authorizationRequestResolver) Sets the resolver used for resolvingOAuth2AuthorizationRequest's.- Parameters:
authorizationRequestResolver- the resolver used for resolvingOAuth2AuthorizationRequest's- Returns:
- the
ServerHttpSecurity.OAuth2LoginSpecfor further configuration - Since:
- 5.2
-
authorizationRedirectStrategy
public ServerHttpSecurity.OAuth2LoginSpec authorizationRedirectStrategy(ServerRedirectStrategy authorizationRedirectStrategy) Sets the redirect strategy for Authorization Endpoint redirect URI.- Parameters:
authorizationRedirectStrategy- the redirect strategy- Returns:
- the
ServerHttpSecurity.OAuth2LoginSpecfor further configuration
-
authenticationMatcher
public ServerHttpSecurity.OAuth2LoginSpec authenticationMatcher(ServerWebExchangeMatcher authenticationMatcher) Sets thematcherused for determining if the request is an authentication request.- Parameters:
authenticationMatcher- thematcherused for determining if the request is an authentication request- Returns:
- the
ServerHttpSecurity.OAuth2LoginSpecfor further configuration - Since:
- 5.2
-
and
Allows method chaining to continue configuring theServerHttpSecurity- Returns:
- the
ServerHttpSecurityto continue configuring
-
configure
-