Interface HttpSecurityBuilder<H extends HttpSecurityBuilder<H>>
- Type Parameters:
H-
- All Superinterfaces:
SecurityBuilder<DefaultSecurityFilterChain>
- All Known Implementing Classes:
HttpSecurity
public interface HttpSecurityBuilder<H extends HttpSecurityBuilder<H>>
extends SecurityBuilder<DefaultSecurityFilterChain>
-
Method Summary
Modifier and TypeMethodDescriptionaddFilter(jakarta.servlet.Filter filter) Adds aFilterthat must be an instance of or extend one of the Filters provided within the Security framework.addFilterAfter(jakarta.servlet.Filter filter, Class<? extends jakarta.servlet.Filter> afterFilter) Allows adding aFilterafter one of the knownFilterclasses.addFilterBefore(jakarta.servlet.Filter filter, Class<? extends jakarta.servlet.Filter> beforeFilter) Allows adding aFilterbefore one of the knownFilterclasses.authenticationProvider(AuthenticationProvider authenticationProvider) Allows adding an additionalAuthenticationProviderto be used<C extends SecurityConfigurer<DefaultSecurityFilterChain,H>>
CgetConfigurer(Class<C> clazz) Gets theSecurityConfigurerby its class name ornullif not found.<C> CgetSharedObject(Class<C> sharedType) Gets a shared Object.<C extends SecurityConfigurer<DefaultSecurityFilterChain,H>>
CremoveConfigurer(Class<C> clazz) Removes theSecurityConfigurerby its class name ornullif not found.<C> voidsetSharedObject(Class<C> sharedType, C object) Sets an object that is shared by multipleSecurityConfigurer.userDetailsService(UserDetailsService userDetailsService) Allows adding an additionalUserDetailsServiceto be usedMethods inherited from interface org.springframework.security.config.annotation.SecurityBuilder
build
-
Method Details
-
getConfigurer
Gets theSecurityConfigurerby its class name ornullif not found. Note that object hierarchies are not considered.- Parameters:
clazz- the Class of theSecurityConfigurerto attempt to get.
-
removeConfigurer
Removes theSecurityConfigurerby its class name ornullif not found. Note that object hierarchies are not considered.- Parameters:
clazz- the Class of theSecurityConfigurerto attempt to remove.- Returns:
- the
SecurityConfigurerthat was removed or null if not found
-
authenticationProvider
Allows adding an additionalAuthenticationProviderto be used- Parameters:
authenticationProvider- theAuthenticationProviderto be added- Returns:
- the
HttpSecurityfor further customizations
-
userDetailsService
Allows adding an additionalUserDetailsServiceto be used- Parameters:
userDetailsService- theUserDetailsServiceto be added- Returns:
- the
HttpSecurityfor further customizations - Throws:
Exception
-
addFilterAfter
H addFilterAfter(jakarta.servlet.Filter filter, Class<? extends jakarta.servlet.Filter> afterFilter) Allows adding aFilterafter one of the knownFilterclasses. The knownFilterinstances are either aFilterlisted inaddFilter(Filter)or aFilterthat has already been added usingaddFilterAfter(Filter, Class)oraddFilterBefore(Filter, Class).- Parameters:
filter- theFilterto register after the typeafterFilterafterFilter- the Class of the knownFilter.- Returns:
- the
HttpSecurityfor further customizations
-
addFilterBefore
H addFilterBefore(jakarta.servlet.Filter filter, Class<? extends jakarta.servlet.Filter> beforeFilter) Allows adding aFilterbefore one of the knownFilterclasses. The knownFilterinstances are either aFilterlisted inaddFilter(Filter)or aFilterthat has already been added usingaddFilterAfter(Filter, Class)oraddFilterBefore(Filter, Class).- Parameters:
filter- theFilterto register before the typebeforeFilterbeforeFilter- the Class of the knownFilter.- Returns:
- the
HttpSecurityfor further customizations
-
addFilter
Adds aFilterthat must be an instance of or extend one of the Filters provided within the Security framework. The method ensures that the ordering of the Filters is automatically taken care of. The ordering of the Filters is:DisableEncodeUrlFilterForceEagerSessionCreationFilterChannelProcessingFilterHttpsRedirectFilterWebAsyncManagerIntegrationFilterSecurityContextHolderFilterSecurityContextPersistenceFilterHeaderWriterFilterCorsFilterCsrfFilterLogoutFilterOAuth2AuthorizationRequestRedirectFilterSaml2WebSsoAuthenticationRequestFilterX509AuthenticationFilterAbstractPreAuthenticatedProcessingFilter- CasAuthenticationFilter
OAuth2LoginAuthenticationFilterSaml2WebSsoAuthenticationFilterUsernamePasswordAuthenticationFilterDefaultLoginPageGeneratingFilterDefaultLogoutPageGeneratingFilterConcurrentSessionFilterDigestAuthenticationFilterBearerTokenAuthenticationFilterBasicAuthenticationFilterAuthenticationFilterRequestCacheAwareFilterSecurityContextHolderAwareRequestFilterJaasApiIntegrationFilterRememberMeAuthenticationFilterAnonymousAuthenticationFilterOAuth2AuthorizationCodeGrantFilterSessionManagementFilterExceptionTranslationFilterFilterSecurityInterceptorAuthorizationFilterSwitchUserFilter
- Parameters:
filter- theFilterto add- Returns:
- the
HttpSecurityfor further customizations
-