You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
로그인된 사용자를 가지고올 때, SecurityContextHolder에서 Authentication 정보를 가져오게 되면 처음에 email, password만 저장해두어서 여기서 가지고올 수 있는 정보가 이 둘뿐이여서 현재는 findByEmail()을 통해 로그인된 사용자 정보를 가져오고 있습니다. 이 외에 더 좋은 방법이 있을까요 ??
Filter를 여러개 사용해도 상관없나요 ??
즉, JwtAuthenticationFilter와 응답값 통일을 위해 ContentCaching...Wrapper로 감싸는 작업을 수행하는 CustomSecurityFilter를 분리해서 사용하는 것이 맞나요? 하나의 필터에서 모든 작업을 하는 것이 맞을까요 ?
이번 주는 어떻게 학습했나요? 아래 질문에 짧게 답변주세요!
이번 주에 학습에 투자한 시간
6시간 정도 걸렸던 것 같습니다.
학습 하면서 좋았던 점과 아쉬웠던 점
이번주에 시간을 많이 투자하지 못한것이 아쉽습니다 ,,
기존에 개발할때는, 응답값 통일이라던지 예외처리 부분은 크게 신경쓰지 않고 진행했었는데 이번에 한번 어떤식으로 처리하는지 배울 수 있어서 좋았던 것 같습니다.
Q. 로그인된 사용자를 가지고올 때, SecurityContextHolder에서 Authentication 정보를 가져오게 되면 처음에 email, password만 저장해두어서 여기서 가지고올 수 있는 정보가 이 둘뿐이여서 현재는 findByEmail()을 통해 로그인된 사용자 정보를 가져오고 있습니다. 이 외에 더 좋은 방법이 있을까요 ??
-> Authentication에 필요한 Object를 저장 할 수도 있습니다. (UserEntity)
위와 같은 방법은 편하지만 추천드리지 않습니다.
-> 만약 토큰을 활용한 방법이 아닌, userEmail 및 password로 사용자 인증을 하신다면.. 현재 방법이 가장 좋아보입니다 :)
추천 : JWT를 활용하여 해당 Token을 발행시에 userId 와 자격권한을 함께 담는 것이 가장 좋습니다. 이렇게 구현할 경우 JWT을 parsing하여 userId(PK)및 권한을 DB에 접근하지 않고 확인할 수 있는 이점이 생깁니다. 추후 user를 찾는 로직은 Authentication에 담겨잇는 userID를 사용하면 됩니다.
Filter를 여러개 사용해도 상관없나요 ??
즉, JwtAuthenticationFilter와 응답값 통일을 위해 ContentCaching...Wrapper로 감싸는 작업을 수행하는 CustomSecurityFilter를 분리해서 사용하는 것이 맞나요? 하나의 필터에서 모든 작업을 하는 것이 맞을까요 ?
-> 관심사를 분리하고 싶으시다면 Filter를 분리하여 작업하셔도 괜찮습니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
이번 주에 어떤 작업을 했는지 설명해주세요.
특히 어떤 부분을 리뷰받고 싶나요?
즉, JwtAuthenticationFilter와 응답값 통일을 위해 ContentCaching...Wrapper로 감싸는 작업을 수행하는 CustomSecurityFilter를 분리해서 사용하는 것이 맞나요? 하나의 필터에서 모든 작업을 하는 것이 맞을까요 ?
이번 주는 어떻게 학습했나요? 아래 질문에 짧게 답변주세요!
이번 주에 학습에 투자한 시간
학습 하면서 좋았던 점과 아쉬웠던 점
어려움을 겪는 부분
스터디 개선되었으면 하는 점