-
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.
- Loading branch information
Showing
12 changed files
with
218 additions
and
19 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
16 changes: 15 additions & 1 deletion
16
src/main/java/com/wakeUpTogetUp/togetUp/api/auth/apple/AppleClient.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 |
---|---|---|
@@ -1,12 +1,26 @@ | ||
package com.wakeUpTogetUp.togetUp.api.auth.apple; | ||
|
||
|
||
import com.wakeUpTogetUp.togetUp.api.auth.dto.request.AppleRevokeReq; | ||
import com.wakeUpTogetUp.togetUp.api.auth.dto.request.AppleTokenReq; | ||
import com.wakeUpTogetUp.togetUp.api.auth.dto.response.AppleTokenRes; | ||
import org.springframework.cloud.openfeign.FeignClient; | ||
import org.springframework.http.MediaType; | ||
import org.springframework.util.LinkedMultiValueMap; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
|
||
@FeignClient(name = "apple-public-key-client", url = "https://appleid.apple.com/auth") | ||
|
||
@FeignClient(name = "apple-public-key-client", url = "https://appleid.apple.com/auth") | ||
public interface AppleClient { | ||
|
||
@GetMapping("/keys") | ||
ApplePublicKeys getApplePublicKeys(); | ||
|
||
@PostMapping(value = "/token",consumes = "application/x-www-form-urlencoded") | ||
AppleTokenRes findAppleToken(@RequestBody AppleTokenReq req); | ||
|
||
@PostMapping(value = "/revoke",consumes = "application/x-www-form-urlencoded") | ||
void revoke(AppleRevokeReq req); | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/com/wakeUpTogetUp/togetUp/api/auth/dto/request/AppleRevokeReq.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,16 @@ | ||
package com.wakeUpTogetUp.togetUp.api.auth.dto.request; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.ToString; | ||
|
||
@Getter | ||
@Builder | ||
@ToString | ||
public class AppleRevokeReq { | ||
private String client_id; | ||
private String client_secret; | ||
private String token; | ||
private String token_type_hint; | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/com/wakeUpTogetUp/togetUp/api/auth/dto/request/AppleTokenReq.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,15 @@ | ||
package com.wakeUpTogetUp.togetUp.api.auth.dto.request; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.ToString; | ||
|
||
@Getter | ||
@Builder | ||
@ToString | ||
public class AppleTokenReq { | ||
private String client_id; | ||
private String client_secret; | ||
private String code; | ||
private String grant_type; | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/com/wakeUpTogetUp/togetUp/api/auth/dto/response/AppleTokenRes.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,24 @@ | ||
package com.wakeUpTogetUp.togetUp.api.auth.dto.response; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.*; | ||
|
||
@ToString | ||
@Getter | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@AllArgsConstructor | ||
public class AppleTokenRes { | ||
@JsonProperty(value = "access_token") | ||
String accessToken; | ||
@JsonProperty(value = "expires_in") | ||
Integer expiresIn; | ||
@JsonProperty(value = "id_token") | ||
String idToken; | ||
@JsonProperty(value = "refresh_token") | ||
String refreshToken; | ||
@JsonProperty(value = "token_type") | ||
String tokenType; | ||
|
||
} |
4 changes: 2 additions & 2 deletions
4
src/main/java/com/wakeUpTogetUp/togetUp/api/auth/kakao/KakaoUserApi.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
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
Oops, something went wrong.