Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: JWT 인증 및 시큐리티 설정 추가 #20

Merged
merged 3 commits into from
Oct 31, 2024

Conversation

hanbirang
Copy link
Collaborator

Pull requests

작업한 내용

#jwt
spring.jwt.secret-key=
spring.jwt.access-expiration=1800
spring.jwt.refresh-expiration = 1209600

위 내용을 추가해주세요

  • jwtUtil 클래스를 JWT 생성 및 유효성 검사 기능 구현
  • CookieUtil을 통한 쿠키 생성 및 삭제 메서드 구현
  • JWT 관련 예외 필터(JwtExceptionFilter) 추가로 인증 오류 처리
  • OAuth 사용자 정보와 UserDetails 인터페이스 통합
  • SecurityConfig 클래스에서 시큐리티 및 CORS 설정 추가
  • ExceptionHandlerConfig를 통한 인증 및 접근 권한 예외 처리 설정

PR Point

  • oauth2와 겹치는 내용이 있어서 그와 관련된 코드들은 되도록 빼고 작성하였습니다
  • oauth2 코드 추가 이후 추가할 내용이 있으니 이 점 염두해주세요!

논의 사항 (선택)

  • 현재 getAuthentication 메서드는 작성되지 않은 상태입니다. 추후 CustomOAuth2Service 등 사용자 정보를 로드하는 메서드를 작성하실 때 추가해주세요!
    • 스프링 security context에 저장되어 사용자 인증 상태를 유지하는데 사용됩니다
  • 또한 JWT 토큰을 검증하여 유효한 인증 객체를 SecurityContextHolder에 설정하는 TokenFilter가 아직 작성되지 않았습니다 (getAuthentication 메서드가 없어서..)
    • 그로 인해 security 설정도 아직 완벽하게 되어있지 않습니다! 필요한 파일들 작성 후 추가해주세요

closed #19

@hanbirang hanbirang requested a review from LEE-GYU-BIN October 30, 2024 10:26
@hanbirang hanbirang self-assigned this Oct 30, 2024
@hanbirang hanbirang linked an issue Oct 30, 2024 that may be closed by this pull request
3 tasks
Copy link
Contributor

@LEE-GYU-BIN LEE-GYU-BIN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

도와주셔서 감사합니다. 해주신거 기반으로 잘 해보겠습니다!

@hanbirang hanbirang merged commit 5a970c0 into main Oct 31, 2024
1 check passed
@hanbirang hanbirang deleted the feature/19-configure-basic-security-and-jwt-settings branch October 31, 2024 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configure Basic Security and JWT Settings
2 participants