Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable Spring Security's login screen? [duplicate]

Spring Security causes / or any path to redirect to /login, and /login to generate and serve a login form. I tried many options like adding these lines to my properties file

security.ignored=/**
spring.security.enabled=false
management.security.enabled=false
security.basic.enabled=false 

Nothing worked.

enter image description here

This has been deprecated maybe.

like image 888
loulou milo Avatar asked Dec 08 '22 13:12

loulou milo


1 Answers

Seems security.ignored=/** has been moved out from Spring Boot 2.x as if Spring Security is on the classpath, Spring Boot will add @EnableWebSecurity so adding entries to the application.properties ain't gonna work.

Here is how you can disable by configuring security config...

@Configuration
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http
                .authorizeRequests()
                .antMatchers("/**").permitAll();
    }
}

Security changes in Spring Boot 2.0 M4

like image 184
kj007 Avatar answered Feb 15 '23 20:02

kj007