Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
요구사항
기본
Spring Security 환경설정
프로젝트에 Spring Security 의존성을 추가하세요.
Security 설정 클래스를 생성하세요.
SecurityFilterChain Bean을 선언하세요.
개발 환경에서 Spring Security 모듈의 로깅 레벨을 trace로 설정하세요.
CSRF 보호 설정하기
CsrfTokenRepository 구현체를 CookieCsrfTokenRepository로 설정하세요.
CsrfTokenRequestHandler 컴포넌트를 대체하세요.
CSRF 토큰을 발급하는 API를 구현하세요.
회원가입
인증 - 로그인
인증 - 세션을 활용한 현재 사용자 정보 조회
인증 - 로그아웃
인가 - 권한 정의
다음과 같이 권한을 정의하세요.
데이터베이스 스키마를 변경하세요.
회원 가입 시 모든 사용자는 USER 권한을 기본 권한으로 설정하세요.
사용자 권한을 수정하는 API를 구현하세요.
애플리케이션 실행 시 ADMIN 권한을 가진 어드민 계정이 초기화되도록 구현하세요.
DiscodietUserDetails.getAuthorities를 수정하세요.
인가 - 권한 적용
심화
세션 관리 고도화
로그인 고도화 - RememberMe
권한 적용 고도화
주요 변경사항
스크린샷
멘토에게