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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description H
addFilter(javax.servlet.Filter filter)
Adds aFilter
that must be an instance of or extend one of the Filters provided within the Security framework.H
addFilterAfter(javax.servlet.Filter filter, java.lang.Class<? extends javax.servlet.Filter> afterFilter)
Allows adding aFilter
after one of the knownFilter
classes.H
addFilterBefore(javax.servlet.Filter filter, java.lang.Class<? extends javax.servlet.Filter> beforeFilter)
Allows adding aFilter
before one of the knownFilter
classes.H
authenticationProvider(AuthenticationProvider authenticationProvider)
Allows adding an additionalAuthenticationProvider
to be used<C extends SecurityConfigurer<DefaultSecurityFilterChain,H>>
CgetConfigurer(java.lang.Class<C> clazz)
Gets theSecurityConfigurer
by its class name ornull
if not found.<C> C
getSharedObject(java.lang.Class<C> sharedType)
Gets a shared Object.<C extends SecurityConfigurer<DefaultSecurityFilterChain,H>>
CremoveConfigurer(java.lang.Class<C> clazz)
Removes theSecurityConfigurer
by its class name ornull
if not found.<C> void
setSharedObject(java.lang.Class<C> sharedType, C object)
Sets an object that is shared by multipleSecurityConfigurer
.H
userDetailsService(UserDetailsService userDetailsService)
Allows adding an additionalUserDetailsService
to be used-
Methods inherited from interface org.springframework.security.config.annotation.SecurityBuilder
build
-
-
-
-
Method Detail
-
getConfigurer
<C extends SecurityConfigurer<DefaultSecurityFilterChain,H>> C getConfigurer(java.lang.Class<C> clazz)
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
<C extends SecurityConfigurer<DefaultSecurityFilterChain,H>> C removeConfigurer(java.lang.Class<C> clazz)
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
-
setSharedObject
<C> void setSharedObject(java.lang.Class<C> sharedType, C object)
Sets an object that is shared by multipleSecurityConfigurer
.- Parameters:
sharedType
- the Class to key the shared object by.object
- the Object to store
-
getSharedObject
<C> C getSharedObject(java.lang.Class<C> sharedType)
Gets a shared Object. Note that object heirarchies are not considered.- Parameters:
sharedType
- the type of the shared Object- Returns:
- the shared Object or null if it is not found
-
authenticationProvider
H authenticationProvider(AuthenticationProvider authenticationProvider)
Allows adding an additionalAuthenticationProvider
to be used- Parameters:
authenticationProvider
- theAuthenticationProvider
to be added- Returns:
- the
HttpSecurity
for further customizations
-
userDetailsService
H userDetailsService(UserDetailsService userDetailsService) throws java.lang.Exception
Allows adding an additionalUserDetailsService
to be used- Parameters:
userDetailsService
- theUserDetailsService
to be added- Returns:
- the
HttpSecurity
for further customizations - Throws:
java.lang.Exception
-
addFilterAfter
H addFilterAfter(javax.servlet.Filter filter, java.lang.Class<? extends javax.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(javax.servlet.Filter filter, java.lang.Class<? extends javax.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
H addFilter(javax.servlet.Filter filter)
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:DisableEncodeUrlFilter
ForceEagerSessionCreationFilter
ChannelProcessingFilter
WebAsyncManagerIntegrationFilter
SecurityContextHolderFilter
SecurityContextPersistenceFilter
HeaderWriterFilter
CorsFilter
CsrfFilter
LogoutFilter
OAuth2AuthorizationRequestRedirectFilter
Saml2WebSsoAuthenticationRequestFilter
X509AuthenticationFilter
AbstractPreAuthenticatedProcessingFilter
- CasAuthenticationFilter
OAuth2LoginAuthenticationFilter
Saml2WebSsoAuthenticationFilter
UsernamePasswordAuthenticationFilter
OpenIDAuthenticationFilter
DefaultLoginPageGeneratingFilter
DefaultLogoutPageGeneratingFilter
ConcurrentSessionFilter
DigestAuthenticationFilter
BearerTokenAuthenticationFilter
BasicAuthenticationFilter
RequestCacheAwareFilter
SecurityContextHolderAwareRequestFilter
JaasApiIntegrationFilter
RememberMeAuthenticationFilter
AnonymousAuthenticationFilter
OAuth2AuthorizationCodeGrantFilter
SessionManagementFilter
ExceptionTranslationFilter
FilterSecurityInterceptor
AuthorizationFilter
SwitchUserFilter
- Parameters:
filter
- theFilter
to add- Returns:
- the
HttpSecurity
for further customizations
-
-