forked from kookmin-sw/cap-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat/refactor kookmin-sw#2 - application yaml 파일 수정 / 파일 구조 변경
feat - naver redirect uri 변경 refactor - security 패키지 생성
- Loading branch information
Showing
12 changed files
with
44 additions
and
152 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
src/main/java/org/capstone/maru/dto/KakaoOAuth2UserInfo.java
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
src/main/java/org/capstone/maru/dto/NaverOAuth2UserInfo.java
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
43 changes: 43 additions & 0 deletions
43
src/main/java/org/capstone/maru/security/OAuth2Response.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package org.capstone.maru.security; | ||
|
||
import java.util.Map; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import org.capstone.maru.domain.MemberAccount; | ||
import org.capstone.maru.security.constant.SocialType; | ||
|
||
@Getter | ||
public abstract class OAuthAttributes { | ||
|
||
/** | ||
* SocialType에 맞는 메소드 호출하여 OAuthAttributes 객체 반환 파라미터 : userNameAttributeName -> OAuth2 로그인 시 | ||
* 키(PK)가 되는 값 / attributes : OAuth 서비스의 유저 정보들 소셜별 of 메소드(ofGoogle, ofKaKao, ofNaver)들은 각각 소셜 | ||
* 로그인 API에서 제공하는 회원의 식별값(id), attributes, nameAttributeKey를 저장 후 build | ||
*/ | ||
public static OAuthAttributes of( | ||
SocialType socialType, | ||
Map<String, Object> attributes | ||
) { | ||
switch (socialType) { | ||
case KAKAO -> { | ||
ofKakao(attributes); | ||
} | ||
case NAVER -> { | ||
ofNaver(attributes); | ||
} | ||
default -> throw new IllegalStateException("Unexpected value: " + socialType); | ||
} | ||
} | ||
|
||
private static OAuthAttributes ofKakao(Map<String, Object> attributes) { | ||
return null; | ||
} | ||
|
||
public static OAuthAttributes ofNaver(Map<String, Object> attributes) { | ||
return null; | ||
} | ||
|
||
public abstract String email(); | ||
|
||
public abstract String nickname(); | ||
} |
File renamed without changes.
File renamed without changes.
This file contains 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