728x90
Spring Security 를 공부하던 중,
예제를 보고 따라하다가 예제에서 사용하는
WebSecurityConfigurerAdapter 가 deprecate 되어있다는 것을 확인했다.
🤨 방법이 새롭게 있겠지..
검색검색
https://docs.spring.io/spring-security/reference/servlet/oauth2/login/advanced.html
Advanced Configuration :: Spring Security
By default, the OAuth 2.0 Login Page is auto-generated by the DefaultLoginPageGeneratingFilter. The default login page shows each configured OAuth Client with its ClientRegistration.clientName as a link, which is capable of initiating the Authorization Req
docs.spring.io
이렇게 쓰라고 알려준다.
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
// csrf cross-site request forgery : 사이트 간 요청 위조
http.csrf().disable()
.authorizeRequests()
.antMatchers("/**").authenticated()
.anyRequest().permitAll();
return http.build();
}
security 에 대해 정의해둔게 없어서
일단 한번 코드 작성해봄..
아무튼 결론만 말하자면 필터체인에 빈을 등록해서 사용하라고 하는 듯 하다.
728x90
'Web > spring' 카테고리의 다른 글
[Spring Entity] Entity 컬럼 안에 리스트 넣는 방법 두가지 (0) | 2022.12.21 |
---|---|
[Spring setting] application.properties 자주 쓰는 설정 (0) | 2022.12.20 |
[Spring Error] Web server failed to start. Port 8080 was already in use. (0) | 2022.12.12 |
[spring gradle] h2 세팅해보기 (0) | 2022.12.10 |
[MAC m1] 개발환경 세팅 / JAVA 11 설치 / 환경변수 설정 (0) | 2022.12.01 |