Spring Boot 2. x 와 Spring Security 5. x 이후 인증 사용 안 함

Spring Boot 2. x 와 Spring Security 5. x 이전 인증 사용 안 함
application. yml 또는 application. properties 에 이 단락 을 추가 합 니 다 (yml 과 properties 의 차 이 는 스스로 검색 하 십시오. 여기 서 설명 합 니 다)
security.basic.enabled=false
management.security.enabled=false

이렇게 하면 팝 업 된 사용자 이름과 비밀번호 입력 을 사용 하지 않 을 수 있 습 니 다.
Spring Boot 2. x 와 Spring Security 5. x 이후 인증 사용 안 함
개편 후, 아래 의 일부 설정 은 모두 폐기 되 었 기 때문이다.
security.basic.authorize-mode
security.basic.enabled
security.basic.path
security.basic.realm
security.enable-csrf
security.headers.cache
security.headers.content-security-policy
security.headers.content-security-policy-mode
security.headers.content-type
security.headers.frame
security.headers.hsts
security.headers.xss
security.ignored
security.require-ssl
security.sessions

위의 설정 에 따라 맞 춰 도 적용 되 지 않 습 니 다.
해결 방안
참조 주소: stackoverflow
시작 클래스 전 @SpringBootApplication 주석 에 exclude 속성 SecurityAutoConfigurationManagementWebSecurityAutoConfiguration 을 추가 하여 안전 인증 을 제거 합 니 다.
@SpringBootApplication(exclude = {SecurityAutoConfiguration.class, 
        ManagementWebSecurityAutoConfiguration.class})
public class DemoApplication {
    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class,args);
    }
}

저의 개인 홈 페이지 에 오신 것 을 환영 합 니 다.
다음으로 전송:https://juejin.im/post/5c8b13e8e51d450c412f2ac4

좋은 웹페이지 즐겨찾기