-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…ss-token feat - 테스트용 카카오 소셜 액세스 토큰 발급 기능 구현
- Loading branch information
Showing
18 changed files
with
129 additions
and
48 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
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
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
9 changes: 9 additions & 0 deletions
9
src/main/java/sopt/org/hmh/global/auth/social/SocialAccessTokenResponse.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,9 @@ | ||
package sopt.org.hmh.global.auth.social; | ||
|
||
import lombok.Builder; | ||
|
||
@Builder | ||
public record SocialAccessTokenResponse( | ||
String socialAccessToken | ||
) { | ||
} |
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
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
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
18 changes: 0 additions & 18 deletions
18
src/main/java/sopt/org/hmh/global/auth/social/apple/request/ApplePublicKeys.java
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
.../social/apple/request/ApplePublicKey.java → ...pple/response/ApplePublicKeyResponse.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
18 changes: 18 additions & 0 deletions
18
src/main/java/sopt/org/hmh/global/auth/social/apple/response/ApplePublicKeysResponse.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,18 @@ | ||
package sopt.org.hmh.global.auth.social.apple.response; | ||
|
||
import java.util.List; | ||
import lombok.Getter; | ||
import sopt.org.hmh.global.auth.jwt.exception.JwtError; | ||
import sopt.org.hmh.global.auth.jwt.exception.JwtException; | ||
|
||
@Getter | ||
public class ApplePublicKeysResponse { | ||
private List<ApplePublicKeyResponse> keys; | ||
|
||
public ApplePublicKeyResponse getMatchesKey(String alg, String kid) { | ||
return keys.stream() | ||
.filter(applePublicKeyResponse -> applePublicKeyResponse.alg().equals(alg) && applePublicKeyResponse.kid().equals(kid)) | ||
.findFirst() | ||
.orElseThrow(() -> new JwtException(JwtError.INVALID_IDENTITY_TOKEN)); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/sopt/org/hmh/global/auth/social/kakao/fegin/KakaoAuthFeignClient.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,19 @@ | ||
package sopt.org.hmh.global.auth.social.kakao.fegin; | ||
|
||
import sopt.org.hmh.global.auth.social.kakao.response.KakaoTokenResponse; | ||
import org.springframework.cloud.openfeign.FeignClient; | ||
import org.springframework.http.MediaType; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
|
||
@FeignClient(name = "kakaoAuthApiClient", url = "https://kauth.kakao.com") | ||
public interface KakaoAuthFeignClient { | ||
|
||
@PostMapping(value = "/oauth/token", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE) | ||
KakaoTokenResponse getOAuth2AccessToken( | ||
@RequestParam("grant_type") String grantType, | ||
@RequestParam("client_id") String clientId, | ||
@RequestParam("redirect_uri") String redirectUri, | ||
@RequestParam("code") String code | ||
); | ||
} |
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
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
2 changes: 1 addition & 1 deletion
2
...th/social/kakao/request/KakaoAccount.java → ...h/social/kakao/response/KakaoAccount.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
10 changes: 10 additions & 0 deletions
10
src/main/java/sopt/org/hmh/global/auth/social/kakao/response/KakaoTokenResponse.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,10 @@ | ||
package sopt.org.hmh.global.auth.social.kakao.response; | ||
|
||
import com.fasterxml.jackson.databind.PropertyNamingStrategies; | ||
import com.fasterxml.jackson.databind.annotation.JsonNaming; | ||
|
||
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) | ||
public record KakaoTokenResponse( | ||
String accessToken | ||
) { | ||
} |
2 changes: 1 addition & 1 deletion
2
...ocial/kakao/request/KakaoUserProfile.java → ...cial/kakao/response/KakaoUserProfile.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
4 changes: 2 additions & 2 deletions
4
...ocial/kakao/request/KakaoUserRequest.java → ...ial/kakao/response/KakaoUserResponse.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
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