Class ServerHttpSecurity.OAuth2LoginSpec
- java.lang.Object
-
- org.springframework.security.config.web.server.ServerHttpSecurity.OAuth2LoginSpec
-
- Enclosing class:
- ServerHttpSecurity
public final class ServerHttpSecurity.OAuth2LoginSpec extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ServerHttpSecurityand()Allows method chaining to continue configuring theServerHttpSecurityServerHttpSecurity.OAuth2LoginSpecauthenticationConverter(org.springframework.security.web.server.authentication.ServerAuthenticationConverter authenticationConverter)Sets the converter to useServerHttpSecurity.OAuth2LoginSpecauthenticationFailureHandler(org.springframework.security.web.server.authentication.ServerAuthenticationFailureHandler authenticationFailureHandler)TheServerAuthenticationFailureHandlerused after authentication failure.ServerHttpSecurity.OAuth2LoginSpecauthenticationManager(org.springframework.security.authentication.ReactiveAuthenticationManager authenticationManager)Configures theReactiveAuthenticationManagerto use.ServerHttpSecurity.OAuth2LoginSpecauthenticationMatcher(org.springframework.security.web.server.util.matcher.ServerWebExchangeMatcher authenticationMatcher)Sets thematcherused for determining if the request is an authentication request.ServerHttpSecurity.OAuth2LoginSpecauthenticationSuccessHandler(org.springframework.security.web.server.authentication.ServerAuthenticationSuccessHandler authenticationSuccessHandler)TheServerAuthenticationSuccessHandlerused after authentication success.ServerHttpSecurity.OAuth2LoginSpecauthorizationRedirectStrategy(org.springframework.security.web.server.ServerRedirectStrategy authorizationRedirectStrategy)Sets the redirect strategy for Authorization Endpoint redirect URI.ServerHttpSecurity.OAuth2LoginSpecauthorizationRequestRepository(org.springframework.security.oauth2.client.web.server.ServerAuthorizationRequestRepository<org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest> authorizationRequestRepository)Sets the repository to use for storingOAuth2AuthorizationRequest's.ServerHttpSecurity.OAuth2LoginSpecauthorizationRequestResolver(org.springframework.security.oauth2.client.web.server.ServerOAuth2AuthorizationRequestResolver authorizationRequestResolver)Sets the resolver used for resolvingOAuth2AuthorizationRequest's.ServerHttpSecurity.OAuth2LoginSpecauthorizedClientRepository(org.springframework.security.oauth2.client.web.server.ServerOAuth2AuthorizedClientRepository authorizedClientRepository)ServerHttpSecurity.OAuth2LoginSpecauthorizedClientService(org.springframework.security.oauth2.client.ReactiveOAuth2AuthorizedClientService authorizedClientService)ServerHttpSecurity.OAuth2LoginSpecclientRegistrationRepository(org.springframework.security.oauth2.client.registration.ReactiveClientRegistrationRepository clientRegistrationRepository)protected voidconfigure(ServerHttpSecurity http)ServerHttpSecurity.OAuth2LoginSpecsecurityContextRepository(org.springframework.security.web.server.context.ServerSecurityContextRepository securityContextRepository)TheServerSecurityContextRepositoryused to save theAuthentication.
-
-
-
Method Detail
-
authenticationManager
public ServerHttpSecurity.OAuth2LoginSpec authenticationManager(org.springframework.security.authentication.ReactiveAuthenticationManager authenticationManager)
Configures theReactiveAuthenticationManagerto use. The default isOAuth2AuthorizationCodeReactiveAuthenticationManager- Parameters:
authenticationManager- the manager to use- Returns:
- the
ServerHttpSecurity.OAuth2LoginSpecto customize
-
securityContextRepository
public ServerHttpSecurity.OAuth2LoginSpec securityContextRepository(org.springframework.security.web.server.context.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(org.springframework.security.web.server.authentication.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(org.springframework.security.web.server.authentication.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(org.springframework.security.web.server.authentication.ServerAuthenticationConverter authenticationConverter)
Sets the converter to use- Parameters:
authenticationConverter- the converter to use- Returns:
- the
ServerHttpSecurity.OAuth2LoginSpecto customize
-
clientRegistrationRepository
public ServerHttpSecurity.OAuth2LoginSpec clientRegistrationRepository(org.springframework.security.oauth2.client.registration.ReactiveClientRegistrationRepository clientRegistrationRepository)
-
authorizedClientService
public ServerHttpSecurity.OAuth2LoginSpec authorizedClientService(org.springframework.security.oauth2.client.ReactiveOAuth2AuthorizedClientService authorizedClientService)
-
authorizedClientRepository
public ServerHttpSecurity.OAuth2LoginSpec authorizedClientRepository(org.springframework.security.oauth2.client.web.server.ServerOAuth2AuthorizedClientRepository authorizedClientRepository)
-
authorizationRequestRepository
public ServerHttpSecurity.OAuth2LoginSpec authorizationRequestRepository(org.springframework.security.oauth2.client.web.server.ServerAuthorizationRequestRepository<org.springframework.security.oauth2.core.endpoint.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(org.springframework.security.oauth2.client.web.server.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(org.springframework.security.web.server.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(org.springframework.security.web.server.util.matcher.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
public ServerHttpSecurity and()
Allows method chaining to continue configuring theServerHttpSecurity- Returns:
- the
ServerHttpSecurityto continue configuring
-
configure
protected void configure(ServerHttpSecurity http)
-
-