-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [fix] : Provider.naver -> Provider.kakao 수정 * [feat] : Naver Oauth 응답객체 NaverResponse 추가 * [feat] : Kakao, Naver 인증 객체에 따른 Oauth 객체 생성 로직 추가
- Loading branch information
Showing
3 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
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
43 changes: 43 additions & 0 deletions
43
src/main/java/com/dnd/gongmuin/security/oauth2/NaverResponse.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 com.dnd.gongmuin.security.oauth2; | ||
|
||
import java.util.Map; | ||
|
||
import com.dnd.gongmuin.member.domain.Provider; | ||
|
||
public class NaverResponse implements Oauth2Response { | ||
|
||
private final Map<String, Object> attribute; | ||
|
||
public NaverResponse(Map<String, Object> attribute) { | ||
this.attribute = (Map<String, Object>)attribute.get("response"); | ||
} | ||
|
||
@Override | ||
public String getProvider() { | ||
return Provider.NAVER.getLabel(); | ||
} | ||
|
||
@Override | ||
public String getProviderId() { | ||
return this.attribute.get("id").toString(); | ||
} | ||
|
||
@Override | ||
public String getEmail() { | ||
return this.attribute.get("email").toString(); | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return this.attribute.get("name").toString(); | ||
} | ||
|
||
@Override | ||
public String createSocialEmail() { | ||
return String.format("%s%s/%s", | ||
this.getProvider(), | ||
this.getProviderId(), | ||
this.getEmail() | ||
); | ||
} | ||
} |
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