Class CoreSecurityConfiguration

java.lang.Object
org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
io.jmix.core.security.CoreSecurityConfiguration
All Implemented Interfaces:
org.springframework.security.config.annotation.SecurityConfigurer<javax.servlet.Filter,org.springframework.security.config.annotation.web.builders.WebSecurity>, org.springframework.security.config.annotation.web.WebSecurityConfigurer<org.springframework.security.config.annotation.web.builders.WebSecurity>

@Order(150) public class CoreSecurityConfiguration extends org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
This security configuration can be used in test or simple projects, for example:
 @SpringBootApplication
 public class SampleApplication {
    // ...

    @EnableWebSecurity
    static class SecurityConfiguration extends CoreSecurityConfiguration {

        @Override
        public UserRepository userRepository() {
                InMemoryCoreUserRepository repository = new InMemoryCoreUserRepository();
                repository.addUser(new CoreUser("admin", "{noop}admin", "Administrator"));
                return repository;
        }
    }
 }
 
  • Constructor Details

    • CoreSecurityConfiguration

      public CoreSecurityConfiguration()
  • Method Details

    • configure

      protected void configure(org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder auth) throws Exception
      Overrides:
      configure in class org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
      Throws:
      Exception
    • configure

      protected void configure(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws Exception
      Overrides:
      configure in class org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
      Throws:
      Exception
    • authenticationManagerBean

      @Bean(name="core_authenticationManager") public org.springframework.security.authentication.AuthenticationManager authenticationManagerBean() throws Exception
      Overrides:
      authenticationManagerBean in class org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
      Throws:
      Exception
    • userRepository

      @Bean(name="core_UserRepository") public UserRepository userRepository()
    • preAuthenticationChecks

      @Bean(name="core_PreAuthenticationChecks") public PreAuthenticationChecks preAuthenticationChecks()
    • postAuthenticationChecks

      @Bean(name="core_PostAuthenticationChecks") public PostAuthenticationChecks postAuthenticationChecks()