Class CoreSecurityConfiguration

java.lang.Object
io.jmix.core.security.CoreSecurityConfiguration

public class CoreSecurityConfiguration extends Object
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

    • securityFilterChain

      @Bean("core_SecurityFilterChain") @Order(400) public org.springframework.security.web.SecurityFilterChain securityFilterChain(org.springframework.security.config.annotation.web.builders.HttpSecurity http, UserRepository userRepository, CoreProperties coreProperties) throws Exception
      Throws:
      Exception
    • authenticationManager

      @Bean(name="core_authenticationManager") public org.springframework.security.authentication.AuthenticationManager authenticationManager(UserRepository userRepository, org.springframework.security.authentication.AuthenticationEventPublisher authenticationEventPublisher, @Qualifier("core_PreAuthenticationChecks") PreAuthenticationChecks preAuthenticationChecks, @Qualifier("core_PostAuthenticationChecks") PostAuthenticationChecks postAuthenticationChecks) throws Exception
      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()
    • authenticationEventPublisher

      @Bean("core_AuthenticationEventPublisher") public org.springframework.security.authentication.DefaultAuthenticationEventPublisher authenticationEventPublisher(org.springframework.context.ApplicationEventPublisher publisher)