Skip to content

Commit

Permalink
feat: add kakao client secret
Browse files Browse the repository at this point in the history
  • Loading branch information
CChuYong committed Jun 29, 2024
1 parent b53570a commit f0e336d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
@ConfigurationPropertiesBinding
public record KakaoOAuthProperties(
String clientId,
String redirectUri
String redirectUri,
String clientSecret
) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ private Mono<String> getKakaoTokenWithCode(String code) {
+ "&redirect_uri="
+ kakaoOAuthProperties.redirectUri()
+"&code="
+ code)
+ code
+ "&client_secret="
+ kakaoOAuthProperties.clientSecret()
)
.retrieve()
.onStatus(status -> !status.is2xxSuccessful(), (res) -> Mono.error(new KakaoLoginFailedException()))
.bodyToMono(LinkedHashMap.class)
Expand All @@ -90,7 +93,7 @@ private Mono<KakaoLoginInfo> getUserInfoWithKakaoToken(String kakaoToken){
.onStatus(status -> !status.is2xxSuccessful(), (res) -> Mono.error(new KakaoLoginFailedException()))
.bodyToMono(LinkedHashMap.class)
.map(map -> new KakaoLoginInfo(
String.valueOf((Long) map.get("id")),
String.valueOf(map.get("id")),
(String) ((LinkedHashMap)map.get("properties")).get("nickname"),
(String) map.get("kakao_account.email")
));
Expand Down
1 change: 1 addition & 0 deletions user-service/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ app:
kakao:
client-id: ${KAKAO_CLIENT_ID}
redirect-uri: ${KAKAO_REDIRECT_URL}
client-secret: ${KAKAO_CLIENT_SECRET}
jwt:
verify-key: ${JWT_VERIFY_KEY}
expiration:
Expand Down

0 comments on commit f0e336d

Please sign in to comment.