Class ComponentBasedSecurityConfiguration
java.lang.Object
info.ejava.examples.svc.authz.authorities.security.ComponentBasedSecurityConfiguration
@Configuration(proxyBeanMethods=false)
@EnableMethodSecurity(prePostEnabled=true,
jsr250Enabled=true,
securedEnabled=true)
public class ComponentBasedSecurityConfiguration
extends Object
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.authentication.AuthenticationManager
authenticationManager
(org.springframework.security.config.annotation.web.builders.HttpSecurity http, org.springframework.security.core.userdetails.UserDetailsService jdbcUserDetailsService) org.springframework.security.web.SecurityFilterChain
authzSecurityFilters
(org.springframework.security.config.annotation.web.builders.HttpSecurity http, org.springframework.security.access.hierarchicalroles.RoleHierarchy roleHierarchy) org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer
org.springframework.security.web.SecurityFilterChain
h2SecurityFilters
(org.springframework.security.config.annotation.web.builders.HttpSecurity http, org.springframework.security.authentication.AuthenticationManager authenticationManager) org.springframework.security.core.userdetails.UserDetailsService
jdbcUserDetailsService
(DataSource userDataSource) (package private) static org.springframework.security.access.expression.method.MethodSecurityExpressionHandler
methodSecurityExpressionHandler
(org.springframework.security.access.hierarchicalroles.RoleHierarchy roleHierarchy, org.springframework.context.ApplicationContext context) Creates a custom MethodExpressionHandler that will be picked up by Expression-based security to support RoleInheritance.(package private) static org.springframework.security.access.hierarchicalroles.RoleHierarchy
Creates a default RoleHierachy when the examples want straight roles.org.springframework.security.crypto.password.PasswordEncoder
(package private) static org.springframework.security.access.hierarchicalroles.RoleHierarchy
-
Constructor Details
-
ComponentBasedSecurityConfiguration
public ComponentBasedSecurityConfiguration()
-
-
Method Details
-
authzStaticResources
@Bean public org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer authzStaticResources() -
authzSecurityFilters
@Bean @Order(0) public org.springframework.security.web.SecurityFilterChain authzSecurityFilters(org.springframework.security.config.annotation.web.builders.HttpSecurity http, org.springframework.security.access.hierarchicalroles.RoleHierarchy roleHierarchy) throws Exception - Throws:
Exception
-
authenticationManager
@Bean public org.springframework.security.authentication.AuthenticationManager authenticationManager(org.springframework.security.config.annotation.web.builders.HttpSecurity http, org.springframework.security.core.userdetails.UserDetailsService jdbcUserDetailsService) throws Exception - Throws:
Exception
-
h2SecurityFilters
@Bean @Order(500) public org.springframework.security.web.SecurityFilterChain h2SecurityFilters(org.springframework.security.config.annotation.web.builders.HttpSecurity http, org.springframework.security.authentication.AuthenticationManager authenticationManager) throws Exception - Throws:
Exception
-
passwordEncoder
@Bean public org.springframework.security.crypto.password.PasswordEncoder passwordEncoder() -
jdbcUserDetailsService
@Bean public org.springframework.security.core.userdetails.UserDetailsService jdbcUserDetailsService(DataSource userDataSource) -
roleHierarchy
@Bean @Profile("roleInheritance") static org.springframework.security.access.hierarchicalroles.RoleHierarchy roleHierarchy() -
nullHierarchy
@Bean @Profile("!roleInheritance") static org.springframework.security.access.hierarchicalroles.RoleHierarchy nullHierarchy()Creates a default RoleHierachy when the examples want straight roles. -
methodSecurityExpressionHandler
static org.springframework.security.access.expression.method.MethodSecurityExpressionHandler methodSecurityExpressionHandler(org.springframework.security.access.hierarchicalroles.RoleHierarchy roleHierarchy, org.springframework.context.ApplicationContext context) Creates a custom MethodExpressionHandler that will be picked up by Expression-based security to support RoleInheritance. This is required until the the following is resolved.
-