본문 바로가기

프로젝트26

Spring Security JWT 유저, Oauth에 대한 대대적인 공사-4(Oauth2 테스트)(성공) 1편 - Local User (https://thcoding.tistory.com/114) 2편 - JWT (https://thcoding.tistory.com/115) 3편 - OAuth2 (https://thcoding.tistory.com/116) 4편 - (현재글)OAuth2 test(https://thcoding.tistory.com/118) deeplify에서 정말 정리가 잘되어있지만 테스트하는방법은 제대로 안나와있어서 엄청 해멨다. 그리고 그 포스팅에서는 프론트 코드도 다 짜셨지만, 나는 프론트코드는 잘 모르기도 하고 프론트분들이 계시기 때문에 프론트 코드 없이 테스트하는 법을 알아보자. ㅇ google 브라우저에 localhost:8080/oauth2/authorization/google .. 2023. 9. 15.
이메일인증을 구현해보자(JavaMailSender) 우리 프로젝트에선 회원가입할때, 이메일인증이 되어야 할 수 있도록 만들기로 했다. 그래서 이메일인증과정을 어떻게 만들었는지에대해 코드리뷰겸 정리해보려고 한다. 가장 첫번째 단계는 구글에 들어가 [Google 계정 관리] 에 들어가서, 왼쪽탭에서 [보안]을 누르고, [2단계인증]을 하고, [앱비밀번호]를 만든다. 앱선택에선 메일로, 나머진 자유. 그렇게 생성하면 [기기용 앱 비밀번호]를 알려주는데 따로 보관하자. 그리고 지메일 설정에 들어가서 [모든 설정]을 눌러주고, 내가 체크한곳을 체크하고 넘어가자. 이 다음단계로 application.yml에다가 설정을 해주자. ㅇ application.yml spring: mail: default-encoding: UTF-8 host: smtp.gmail.com p.. 2023. 9. 15.
Spring Security JWT 유저, Oauth에 대한 대대적인 공사-3(Oauth2) 1편 - Local User (https://thcoding.tistory.com/114) 2편 - JWT (https://thcoding.tistory.com/115) 3편 - (현재글) OAuth2 (https://thcoding.tistory.com/116) 4편 - OAuth2 test(https://thcoding.tistory.com/118) 저번 포스팅 JWT에 이어서 oauth2 에 관련된 코드들에대해 리뷰를 해보겠다. 코드가 엄청 많다. 가장먼저 엔티티 정리부터 하고가자. 엔티티 ㅇ AuthReqModel @Getter @Setter @NoArgsConstructor @AllArgsConstructor public class AuthReqModel { private String id; p.. 2023. 9. 14.
Spring Security JWT 유저, Oauth에 대한 대대적인 공사-2(JWT) 1편 - Local User (https://thcoding.tistory.com/114) 2편 - (현재글)JWT (https://thcoding.tistory.com/115) 3편 - OAuth2 (https://thcoding.tistory.com/116) 4편 - OAuth2 test(https://thcoding.tistory.com/118) 저번 포스팅은 local User이 사용하는 코드에대한 리뷰였고 이번엔 JWT에 관한 코드들을 리뷰해보겠다. JWT 란, Json Web token의 약자고, 일종의 사용기한이 있는 신분증같은것이다. 예를 들어, 유저가 비밀번호를 업데이트를 하고자 한다 치면, 이 유저는 인증이 되어있어야한다. 이 유저가 로그인할때 우리는 토큰을 주고, 유저는 이 토큰을 갖.. 2023. 9. 13.