List of usage examples for org.springframework.security.config.annotation.web.builders HttpSecurity getConfigurer
<C extends SecurityConfigurer<DefaultSecurityFilterChain, H>> C getConfigurer(Class<C> clazz);
null
if not found. From source file:sample.MyConfigurer.java
@SuppressWarnings("unchecked") @Override//from ww w . j av a 2 s . c o m public void init(HttpSecurity http) throws Exception { // autowire this bean ApplicationContext context = http.getSharedObject(ApplicationContext.class); context.getAutowireCapableBeanFactory().autowireBean(this); // Our DSL allows to grant access to URLs defined by permitAllPattern in a property // and then requires authentication for any other request http.authorizeRequests().antMatchers(permitAllPattern).permitAll().anyRequest().authenticated(); if (http.getConfigurer(FormLoginConfigurer.class) == null) { // only apply if formLogin() was not invoked by the user // this is a way of providing a default, but allow users to override http.formLogin().loginPage(loginPage); } }