Class JeeConfigurer<H extends HttpSecurityBuilder<H>>
- java.lang.Object
-
- org.springframework.security.config.annotation.SecurityConfigurerAdapter<org.springframework.security.web.DefaultSecurityFilterChain,B>
-
- org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer<JeeConfigurer<H>,H>
-
- org.springframework.security.config.annotation.web.configurers.JeeConfigurer<H>
-
- All Implemented Interfaces:
SecurityConfigurer<org.springframework.security.web.DefaultSecurityFilterChain,H>
public final class JeeConfigurer<H extends HttpSecurityBuilder<H>> extends AbstractHttpConfigurer<JeeConfigurer<H>,H>
Adds support for J2EE pre authentication.Security Filters
The following Filters are populatedJ2eePreAuthenticatedProcessingFilter
Shared Objects Created
AuthenticationEntryPointis populated with anHttp403ForbiddenEntryPoint- A
PreAuthenticatedAuthenticationProvideris populated intoHttpSecurity.authenticationProvider(org.springframework.security.authentication.AuthenticationProvider)
Shared Objects Used
The following shared objects are used:AuthenticationManager
- Since:
- 3.2
-
-
Constructor Summary
Constructors Constructor Description JeeConfigurer()Creates a new instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JeeConfigurer<H>authenticatedUserDetailsService(org.springframework.security.core.userdetails.AuthenticationUserDetailsService<org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationToken> authenticatedUserDetailsService)Specifies theAuthenticationUserDetailsServicethat is used with thePreAuthenticatedAuthenticationProvider.voidconfigure(H http)Configure theSecurityBuilderby setting the necessary properties on theSecurityBuilder.voidinit(H http)Populates aPreAuthenticatedAuthenticationProviderintoHttpSecurity.authenticationProvider(org.springframework.security.authentication.AuthenticationProvider)and aHttp403ForbiddenEntryPointintoHttpSecurityBuilder.setSharedObject(Class, Object)JeeConfigurer<H>j2eePreAuthenticatedProcessingFilter(org.springframework.security.web.authentication.preauth.j2ee.J2eePreAuthenticatedProcessingFilter j2eePreAuthenticatedProcessingFilter)Allows specifying theJ2eePreAuthenticatedProcessingFilterto use.JeeConfigurer<H>mappableAuthorities(java.lang.String... mappableRoles)Specifies roles to use map from theHttpServletRequestto theUserDetails.JeeConfigurer<H>mappableAuthorities(java.util.Set<java.lang.String> mappableRoles)Specifies roles to use map from theHttpServletRequestto theUserDetails.JeeConfigurer<H>mappableRoles(java.lang.String... mappableRoles)Specifies roles to use map from theHttpServletRequestto theUserDetailsand automatically prefixes it with "ROLE_".-
Methods inherited from class org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer
disable, withObjectPostProcessor
-
Methods inherited from class org.springframework.security.config.annotation.SecurityConfigurerAdapter
addObjectPostProcessor, and, getBuilder, postProcess, setBuilder
-
-
-
-
Constructor Detail
-
JeeConfigurer
public JeeConfigurer()
Creates a new instance- See Also:
HttpSecurity.jee()
-
-
Method Detail
-
mappableAuthorities
public JeeConfigurer<H> mappableAuthorities(java.lang.String... mappableRoles)
Specifies roles to use map from theHttpServletRequestto theUserDetails. IfHttpServletRequest.isUserInRole(String)returns true, the role is added to theUserDetails. This method is the equivalent of invokingmappableAuthorities(Set). Multiple invocations ofmappableAuthorities(String...)will override previous invocations.There are no default roles that are mapped.
- Parameters:
mappableRoles- the roles to attempt to map to theUserDetails(i.e. "ROLE_USER", "ROLE_ADMIN", etc).- Returns:
- the
JeeConfigurerfor further customizations - See Also:
SimpleMappableAttributesRetriever,mappableRoles(String...)
-
mappableRoles
public JeeConfigurer<H> mappableRoles(java.lang.String... mappableRoles)
Specifies roles to use map from theHttpServletRequestto theUserDetailsand automatically prefixes it with "ROLE_". IfHttpServletRequest.isUserInRole(String)returns true, the role is added to theUserDetails. This method is the equivalent of invokingmappableAuthorities(Set). Multiple invocations ofmappableRoles(String...)will override previous invocations.There are no default roles that are mapped.
- Parameters:
mappableRoles- the roles to attempt to map to theUserDetails(i.e. "USER", "ADMIN", etc).- Returns:
- the
JeeConfigurerfor further customizations - See Also:
SimpleMappableAttributesRetriever,mappableAuthorities(String...)
-
mappableAuthorities
public JeeConfigurer<H> mappableAuthorities(java.util.Set<java.lang.String> mappableRoles)
Specifies roles to use map from theHttpServletRequestto theUserDetails. IfHttpServletRequest.isUserInRole(String)returns true, the role is added to theUserDetails. This is the equivalent ofmappableRoles(String...). Multiple invocations ofmappableAuthorities(Set)will override previous invocations.There are no default roles that are mapped.
- Parameters:
mappableRoles- the roles to attempt to map to theUserDetails.- Returns:
- the
JeeConfigurerfor further customizations - See Also:
SimpleMappableAttributesRetriever
-
authenticatedUserDetailsService
public JeeConfigurer<H> authenticatedUserDetailsService(org.springframework.security.core.userdetails.AuthenticationUserDetailsService<org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationToken> authenticatedUserDetailsService)
Specifies theAuthenticationUserDetailsServicethat is used with thePreAuthenticatedAuthenticationProvider. The default is aPreAuthenticatedGrantedAuthoritiesUserDetailsService.- Parameters:
authenticatedUserDetailsService- theAuthenticationUserDetailsServiceto use.- Returns:
- the
JeeConfigurerfor further configuration
-
j2eePreAuthenticatedProcessingFilter
public JeeConfigurer<H> j2eePreAuthenticatedProcessingFilter(org.springframework.security.web.authentication.preauth.j2ee.J2eePreAuthenticatedProcessingFilter j2eePreAuthenticatedProcessingFilter)
Allows specifying theJ2eePreAuthenticatedProcessingFilterto use. IfJ2eePreAuthenticatedProcessingFilteris provided, all of its attributes must also be configured manually (i.e. all attributes populated in theJeeConfigurerare not used).- Parameters:
j2eePreAuthenticatedProcessingFilter- theJ2eePreAuthenticatedProcessingFilterto use.- Returns:
- the
JeeConfigurerfor further configuration
-
init
public void init(H http)
Populates aPreAuthenticatedAuthenticationProviderintoHttpSecurity.authenticationProvider(org.springframework.security.authentication.AuthenticationProvider)and aHttp403ForbiddenEntryPointintoHttpSecurityBuilder.setSharedObject(Class, Object)- Specified by:
initin interfaceSecurityConfigurer<org.springframework.security.web.DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>>- Overrides:
initin classSecurityConfigurerAdapter<org.springframework.security.web.DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>>- See Also:
SecurityConfigurerAdapter.init(org.springframework.security.config.annotation.SecurityBuilder)
-
configure
public void configure(H http)
Description copied from interface:SecurityConfigurerConfigure theSecurityBuilderby setting the necessary properties on theSecurityBuilder.- Specified by:
configurein interfaceSecurityConfigurer<org.springframework.security.web.DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>>- Overrides:
configurein classSecurityConfigurerAdapter<org.springframework.security.web.DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>>
-
-