Class OAuth2AuthorizationServerConfigurer
java.lang.Object
org.springframework.security.config.annotation.SecurityConfigurerAdapter<org.springframework.security.web.DefaultSecurityFilterChain,B>
org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer<OAuth2AuthorizationServerConfigurer,org.springframework.security.config.annotation.web.builders.HttpSecurity>
org.springframework.security.oauth2.server.authorization.config.annotation.web.configurers.OAuth2AuthorizationServerConfigurer
- All Implemented Interfaces:
org.springframework.security.config.annotation.SecurityConfigurer<org.springframework.security.web.DefaultSecurityFilterChain,org.springframework.security.config.annotation.web.builders.HttpSecurity>
public final class OAuth2AuthorizationServerConfigurer
extends org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer<OAuth2AuthorizationServerConfigurer,org.springframework.security.config.annotation.web.builders.HttpSecurity>
An
AbstractHttpConfigurer for OAuth 2.0 Authorization Server support.- Since:
- 0.0.1
- See Also:
-
AbstractHttpConfigurerOAuth2ClientAuthenticationConfigurerOAuth2AuthorizationServerMetadataEndpointConfigurerOAuth2AuthorizationEndpointConfigurerOAuth2PushedAuthorizationRequestEndpointConfigurerOAuth2TokenEndpointConfigurerOAuth2TokenIntrospectionEndpointConfigurerOAuth2TokenRevocationEndpointConfigurerOAuth2DeviceAuthorizationEndpointConfigurerOAuth2DeviceVerificationEndpointConfigurerOidcConfigurerRegisteredClientRepositoryOAuth2AuthorizationServiceOAuth2AuthorizationConsentServiceNimbusJwkSetEndpointFilter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionauthorizationConsentService(OAuth2AuthorizationConsentService authorizationConsentService) Sets the authorization consent service.authorizationEndpoint(org.springframework.security.config.Customizer<OAuth2AuthorizationEndpointConfigurer> authorizationEndpointCustomizer) Configures the OAuth 2.0 Authorization Endpoint.Returns a new instance ofOAuth2AuthorizationServerConfigurerfor configuring.authorizationServerMetadataEndpoint(org.springframework.security.config.Customizer<OAuth2AuthorizationServerMetadataEndpointConfigurer> authorizationServerMetadataEndpointCustomizer) Configures the OAuth 2.0 Authorization Server Metadata Endpoint.authorizationServerSettings(AuthorizationServerSettings authorizationServerSettings) Sets the authorization server settings.authorizationService(OAuth2AuthorizationService authorizationService) Sets the authorization service.clientAuthentication(org.springframework.security.config.Customizer<OAuth2ClientAuthenticationConfigurer> clientAuthenticationCustomizer) Configures OAuth 2.0 Client Authentication.voidconfigure(org.springframework.security.config.annotation.web.builders.HttpSecurity httpSecurity) deviceAuthorizationEndpoint(org.springframework.security.config.Customizer<OAuth2DeviceAuthorizationEndpointConfigurer> deviceAuthorizationEndpointCustomizer) Configures the OAuth 2.0 Device Authorization Endpoint.deviceVerificationEndpoint(org.springframework.security.config.Customizer<OAuth2DeviceVerificationEndpointConfigurer> deviceVerificationEndpointCustomizer) Configures the OAuth 2.0 Device Verification Endpoint.org.springframework.security.web.util.matcher.RequestMatcherReturns aRequestMatcherfor the authorization server endpoints.voidinit(org.springframework.security.config.annotation.web.builders.HttpSecurity httpSecurity) oidc(org.springframework.security.config.Customizer<OidcConfigurer> oidcCustomizer) Configures OpenID Connect 1.0 support (disabled by default).pushedAuthorizationRequestEndpoint(org.springframework.security.config.Customizer<OAuth2PushedAuthorizationRequestEndpointConfigurer> pushedAuthorizationRequestEndpointCustomizer) Configures the OAuth 2.0 Pushed Authorization Request Endpoint.registeredClientRepository(RegisteredClientRepository registeredClientRepository) Sets the repository of registered clients.tokenEndpoint(org.springframework.security.config.Customizer<OAuth2TokenEndpointConfigurer> tokenEndpointCustomizer) Configures the OAuth 2.0 Token Endpoint.tokenGenerator(OAuth2TokenGenerator<? extends org.springframework.security.oauth2.core.OAuth2Token> tokenGenerator) Sets the token generator.tokenIntrospectionEndpoint(org.springframework.security.config.Customizer<OAuth2TokenIntrospectionEndpointConfigurer> tokenIntrospectionEndpointCustomizer) Configures the OAuth 2.0 Token Introspection Endpoint.tokenRevocationEndpoint(org.springframework.security.config.Customizer<OAuth2TokenRevocationEndpointConfigurer> tokenRevocationEndpointCustomizer) Configures the OAuth 2.0 Token Revocation Endpoint.Methods inherited from class org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer
disable, getSecurityContextHolderStrategy, withObjectPostProcessor, withObjectPostProcessorMethods inherited from class org.springframework.security.config.annotation.SecurityConfigurerAdapter
addObjectPostProcessor, addObjectPostProcessor, and, getBuilder, postProcess, setBuilder
-
Constructor Details
-
OAuth2AuthorizationServerConfigurer
public OAuth2AuthorizationServerConfigurer()
-
-
Method Details
-
authorizationServer
Returns a new instance ofOAuth2AuthorizationServerConfigurerfor configuring.- Returns:
- a new instance of
OAuth2AuthorizationServerConfigurerfor configuring - Since:
- 1.4
-
registeredClientRepository
public OAuth2AuthorizationServerConfigurer registeredClientRepository(RegisteredClientRepository registeredClientRepository) Sets the repository of registered clients.- Parameters:
registeredClientRepository- the repository of registered clients- Returns:
- the
OAuth2AuthorizationServerConfigurerfor further configuration
-
authorizationService
public OAuth2AuthorizationServerConfigurer authorizationService(OAuth2AuthorizationService authorizationService) Sets the authorization service.- Parameters:
authorizationService- the authorization service- Returns:
- the
OAuth2AuthorizationServerConfigurerfor further configuration
-
authorizationConsentService
public OAuth2AuthorizationServerConfigurer authorizationConsentService(OAuth2AuthorizationConsentService authorizationConsentService) Sets the authorization consent service.- Parameters:
authorizationConsentService- the authorization consent service- Returns:
- the
OAuth2AuthorizationServerConfigurerfor further configuration
-
authorizationServerSettings
public OAuth2AuthorizationServerConfigurer authorizationServerSettings(AuthorizationServerSettings authorizationServerSettings) Sets the authorization server settings.- Parameters:
authorizationServerSettings- the authorization server settings- Returns:
- the
OAuth2AuthorizationServerConfigurerfor further configuration
-
tokenGenerator
public OAuth2AuthorizationServerConfigurer tokenGenerator(OAuth2TokenGenerator<? extends org.springframework.security.oauth2.core.OAuth2Token> tokenGenerator) Sets the token generator.- Parameters:
tokenGenerator- the token generator- Returns:
- the
OAuth2AuthorizationServerConfigurerfor further configuration - Since:
- 0.2.3
-
clientAuthentication
public OAuth2AuthorizationServerConfigurer clientAuthentication(org.springframework.security.config.Customizer<OAuth2ClientAuthenticationConfigurer> clientAuthenticationCustomizer) Configures OAuth 2.0 Client Authentication.- Parameters:
clientAuthenticationCustomizer- theCustomizerproviding access to theOAuth2ClientAuthenticationConfigurer- Returns:
- the
OAuth2AuthorizationServerConfigurerfor further configuration
-
authorizationServerMetadataEndpoint
public OAuth2AuthorizationServerConfigurer authorizationServerMetadataEndpoint(org.springframework.security.config.Customizer<OAuth2AuthorizationServerMetadataEndpointConfigurer> authorizationServerMetadataEndpointCustomizer) Configures the OAuth 2.0 Authorization Server Metadata Endpoint.- Parameters:
authorizationServerMetadataEndpointCustomizer- theCustomizerproviding access to theOAuth2AuthorizationServerMetadataEndpointConfigurer- Returns:
- the
OAuth2AuthorizationServerConfigurerfor further configuration - Since:
- 0.4.0
-
authorizationEndpoint
public OAuth2AuthorizationServerConfigurer authorizationEndpoint(org.springframework.security.config.Customizer<OAuth2AuthorizationEndpointConfigurer> authorizationEndpointCustomizer) Configures the OAuth 2.0 Authorization Endpoint.- Parameters:
authorizationEndpointCustomizer- theCustomizerproviding access to theOAuth2AuthorizationEndpointConfigurer- Returns:
- the
OAuth2AuthorizationServerConfigurerfor further configuration
-
pushedAuthorizationRequestEndpoint
public OAuth2AuthorizationServerConfigurer pushedAuthorizationRequestEndpoint(org.springframework.security.config.Customizer<OAuth2PushedAuthorizationRequestEndpointConfigurer> pushedAuthorizationRequestEndpointCustomizer) Configures the OAuth 2.0 Pushed Authorization Request Endpoint.- Parameters:
pushedAuthorizationRequestEndpointCustomizer- theCustomizerproviding access to theOAuth2PushedAuthorizationRequestEndpointConfigurer- Returns:
- the
OAuth2AuthorizationServerConfigurerfor further configuration - Since:
- 1.5
-
tokenEndpoint
public OAuth2AuthorizationServerConfigurer tokenEndpoint(org.springframework.security.config.Customizer<OAuth2TokenEndpointConfigurer> tokenEndpointCustomizer) Configures the OAuth 2.0 Token Endpoint.- Parameters:
tokenEndpointCustomizer- theCustomizerproviding access to theOAuth2TokenEndpointConfigurer- Returns:
- the
OAuth2AuthorizationServerConfigurerfor further configuration
-
tokenIntrospectionEndpoint
public OAuth2AuthorizationServerConfigurer tokenIntrospectionEndpoint(org.springframework.security.config.Customizer<OAuth2TokenIntrospectionEndpointConfigurer> tokenIntrospectionEndpointCustomizer) Configures the OAuth 2.0 Token Introspection Endpoint.- Parameters:
tokenIntrospectionEndpointCustomizer- theCustomizerproviding access to theOAuth2TokenIntrospectionEndpointConfigurer- Returns:
- the
OAuth2AuthorizationServerConfigurerfor further configuration - Since:
- 0.2.3
-
tokenRevocationEndpoint
public OAuth2AuthorizationServerConfigurer tokenRevocationEndpoint(org.springframework.security.config.Customizer<OAuth2TokenRevocationEndpointConfigurer> tokenRevocationEndpointCustomizer) Configures the OAuth 2.0 Token Revocation Endpoint.- Parameters:
tokenRevocationEndpointCustomizer- theCustomizerproviding access to theOAuth2TokenRevocationEndpointConfigurer- Returns:
- the
OAuth2AuthorizationServerConfigurerfor further configuration - Since:
- 0.2.2
-
deviceAuthorizationEndpoint
public OAuth2AuthorizationServerConfigurer deviceAuthorizationEndpoint(org.springframework.security.config.Customizer<OAuth2DeviceAuthorizationEndpointConfigurer> deviceAuthorizationEndpointCustomizer) Configures the OAuth 2.0 Device Authorization Endpoint.- Parameters:
deviceAuthorizationEndpointCustomizer- theCustomizerproviding access to theOAuth2DeviceAuthorizationEndpointConfigurer- Returns:
- the
OAuth2AuthorizationServerConfigurerfor further configuration - Since:
- 1.1
-
deviceVerificationEndpoint
public OAuth2AuthorizationServerConfigurer deviceVerificationEndpoint(org.springframework.security.config.Customizer<OAuth2DeviceVerificationEndpointConfigurer> deviceVerificationEndpointCustomizer) Configures the OAuth 2.0 Device Verification Endpoint.- Parameters:
deviceVerificationEndpointCustomizer- theCustomizerproviding access to theOAuth2DeviceVerificationEndpointConfigurer- Returns:
- the
OAuth2AuthorizationServerConfigurerfor further configuration - Since:
- 1.1
-
oidc
public OAuth2AuthorizationServerConfigurer oidc(org.springframework.security.config.Customizer<OidcConfigurer> oidcCustomizer) Configures OpenID Connect 1.0 support (disabled by default).- Parameters:
oidcCustomizer- theCustomizerproviding access to theOidcConfigurer- Returns:
- the
OAuth2AuthorizationServerConfigurerfor further configuration
-
getEndpointsMatcher
public org.springframework.security.web.util.matcher.RequestMatcher getEndpointsMatcher()Returns aRequestMatcherfor the authorization server endpoints.- Returns:
- a
RequestMatcherfor the authorization server endpoints
-
init
public void init(org.springframework.security.config.annotation.web.builders.HttpSecurity httpSecurity) throws Exception - Specified by:
initin interfaceorg.springframework.security.config.annotation.SecurityConfigurer<org.springframework.security.web.DefaultSecurityFilterChain,org.springframework.security.config.annotation.web.builders.HttpSecurity> - Overrides:
initin classorg.springframework.security.config.annotation.SecurityConfigurerAdapter<org.springframework.security.web.DefaultSecurityFilterChain,org.springframework.security.config.annotation.web.builders.HttpSecurity> - Throws:
Exception
-
configure
public void configure(org.springframework.security.config.annotation.web.builders.HttpSecurity httpSecurity) - Specified by:
configurein interfaceorg.springframework.security.config.annotation.SecurityConfigurer<org.springframework.security.web.DefaultSecurityFilterChain,org.springframework.security.config.annotation.web.builders.HttpSecurity> - Overrides:
configurein classorg.springframework.security.config.annotation.SecurityConfigurerAdapter<org.springframework.security.web.DefaultSecurityFilterChain,org.springframework.security.config.annotation.web.builders.HttpSecurity>
-