Skip to content

스프링 시큐리티 & 로그인#23

Open
seungheon123 wants to merge 14 commits intodevelopfrom
feat/12
Open

스프링 시큐리티 & 로그인#23
seungheon123 wants to merge 14 commits intodevelopfrom
feat/12

Conversation

@seungheon123
Copy link
Contributor

주요 변경 사항

1. Spring Security 설정

  • SecurityConfig 클래스에 Spring Security 기본 설정을 추가하고, '/login' 경로에 대해 모든 사용자에게 접근을 허용
  • JWT 토큰을 사용하여 사용자 인증을 처리하도록 설정
  • 토큰 인증 실패 시 예외 처리

2. JWT 유틸리티 클래스 구현

  • JWT 토큰 생성, 유효성 검사
  • 모든 메서드는 Static Method로 구현

3. 일반 로그인 기능 구현

  • AuthController에 로그인 엔드포인트 추가
  • 로그인 성공 시 JWT 토큰을 반환
  • 이메일, 비밀번호 불일치 등의 예외 처리

4. 단위 테스트 추가

  • 로그인 기능에 대한 단위 테스트 추가

관련 이슈

[#12] 스프링 필터 등록

@seungheon123 seungheon123 added 🐛 Fix 버그 수정 🙈 Chore 패키지 매니저 수정, 그 외 기타 수정 ✨ Feat 새로운 기능 추가 labels Jul 2, 2024
@seungheon123 seungheon123 self-assigned this Jul 2, 2024
@seungheon123 seungheon123 linked an issue Jul 2, 2024 that may be closed by this pull request
Copy link
Contributor

Choose a reason for hiding this comment

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

요즘은 implementation말고 api로 하나요? 신기하네용

Copy link
Contributor Author

Choose a reason for hiding this comment

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

둘 다 사용하는데 implementation을 사용하면 다른 모듈에서 spring-data-jpa에 대한 의존성을 못찾아서 api로 변경했습니다

Copy link
Contributor

Choose a reason for hiding this comment

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

그런데 api와 implementation의차이가 뭔가요? 위에서 보면
api project(':Common')
implementation project(':Domain')

이렇게 있던데 어떤 차이가 있어서 다른때 사용하나요?

Copy link
Contributor

Choose a reason for hiding this comment

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

api로 하면 의존성을 찾아주는 건가요? 알아서요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

implementation을 사용하면 직접 참조하고 있는 모듈에만 접근할 수 있는데 api를 사용하면 직접/간접 참조하고 있는 모듈에 모두 접근할 수 있어요. 자세한 내용은 오류 페이지에 정리해뒀어요

Copy link
Contributor

Choose a reason for hiding this comment

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

네 조아요

Copy link
Contributor

Choose a reason for hiding this comment

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

왜 갑자기 이렇게 바꾼건가요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ㅎㅎ 수정했습니다

@seungheon123 seungheon123 removed the request for review from hongyeee July 7, 2024 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 Fix 버그 수정 🙈 Chore 패키지 매니저 수정, 그 외 기타 수정 ✨ Feat 새로운 기능 추가

Projects

None yet

Development

Successfully merging this pull request may close these issues.

스프링 필터 등록

2 participants