membersound :
In spring-boot-1.x I had the following configuration to disable the basic security in dev mode:
application.properties:
security.basic.enabled=false
application-test.properties:
security.basic.enabled=true
application-prod.properties:
security.basic.enabled=true
As of spring-boot-2.x the property is no longer supported. How can I achieve the same configuration (=disable any security related features and configuration in default profile)?
Golam Mazid sajib :
Here is configuration class. here permit for all url:
@Configuration
@ConditionalOnProperty(value = "app.security.basic.enabled", havingValue = "false")
public class WebSecurityConfig extends WebSecurityConfigurerAdapter{
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable()
.authorizeRequests()
.antMatchers("/**").permitAll()
.anyRequest().authenticated();
}
}