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 aFilter
that 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 aFilter
after one of the knownFilter
classes.addFilterBefore
(jakarta.servlet.Filter filter, Class<? extends jakarta.servlet.Filter> beforeFilter) Allows adding aFilter
before one of the knownFilter
classes.authenticationProvider
(AuthenticationProvider authenticationProvider) Allows adding an additionalAuthenticationProvider
to be used<C extends SecurityConfigurer<DefaultSecurityFilterChain,
H>>
CgetConfigurer
(Class<C> clazz) Gets theSecurityConfigurer
by its class name ornull
if not found.<C> C
getSharedObject
(Class<C> sharedType) Gets a shared Object.<C extends SecurityConfigurer<DefaultSecurityFilterChain,
H>>
CremoveConfigurer
(Class<C> clazz) Removes theSecurityConfigurer
by its class name ornull
if not found.<C> void
setSharedObject
(Class<C> sharedType, C object) Sets an object that is shared by multipleSecurityConfigurer
.userDetailsService
(UserDetailsService userDetailsService) Allows adding an additionalUserDetailsService
to be usedMethods inherited from interface org.springframework.security.config.annotation.SecurityBuilder
build
-
Method Details
-
getConfigurer
Gets theSecurityConfigurer
by its class name ornull
if not found. Note that object hierarchies are not considered.- Parameters:
clazz
- the Class of theSecurityConfigurer
to attempt to get.
-
removeConfigurer
Removes theSecurityConfigurer
by its class name ornull
if not found. Note that object hierarchies are not considered.- Parameters:
clazz
- the Class of theSecurityConfigurer
to attempt to remove.- Returns:
- the
SecurityConfigurer
that was removed or null if not found
-
authenticationProvider
Allows adding an additionalAuthenticationProvider
to be used- Parameters:
authenticationProvider
- theAuthenticationProvider
to be added- Returns:
- the
HttpSecurity
for further customizations
-
userDetailsService
Allows adding an additionalUserDetailsService
to be used- Parameters:
userDetailsService
- theUserDetailsService
to be added- Returns:
- the
HttpSecurity
for further customizations - Throws:
Exception
-
addFilterAfter
H addFilterAfter(jakarta.servlet.Filter filter, Class<? extends jakarta.servlet.Filter> afterFilter) Allows adding aFilter
after one of the knownFilter
classes. The knownFilter
instances are either aFilter
listed inaddFilter(Filter)
or aFilter
that has already been added usingaddFilterAfter(Filter, Class)
oraddFilterBefore(Filter, Class)
.- Parameters:
filter
- theFilter
to register after the typeafterFilter
afterFilter
- the Class of the knownFilter
.- Returns:
- the
HttpSecurity
for further customizations
-
addFilterBefore
H addFilterBefore(jakarta.servlet.Filter filter, Class<? extends jakarta.servlet.Filter> beforeFilter) Allows adding aFilter
before one of the knownFilter
classes. The knownFilter
instances are either aFilter
listed inaddFilter(Filter)
or aFilter
that has already been added usingaddFilterAfter(Filter, Class)
oraddFilterBefore(Filter, Class)
.- Parameters:
filter
- theFilter
to register before the typebeforeFilter
beforeFilter
- the Class of the knownFilter
.- Returns:
- the
HttpSecurity
for further customizations
-
addFilter
Adds aFilter
that 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:ForceEagerSessionCreationFilter
DisableEncodeUrlFilter
ChannelProcessingFilter
SecurityContextPersistenceFilter
LogoutFilter
X509AuthenticationFilter
AbstractPreAuthenticatedProcessingFilter
- CasAuthenticationFilter
UsernamePasswordAuthenticationFilter
DefaultLoginPageGeneratingFilter
DefaultLogoutPageGeneratingFilter
ConcurrentSessionFilter
DigestAuthenticationFilter
BearerTokenAuthenticationFilter
BasicAuthenticationFilter
RequestCacheAwareFilter
SecurityContextHolderAwareRequestFilter
JaasApiIntegrationFilter
RememberMeAuthenticationFilter
AnonymousAuthenticationFilter
SessionManagementFilter
ExceptionTranslationFilter
FilterSecurityInterceptor
SwitchUserFilter
- Parameters:
filter
- theFilter
to add- Returns:
- the
HttpSecurity
for further customizations
-