Skip to content

Commit

Permalink
#5 feat: KeyId 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
shinhn committed Oct 7, 2022
1 parent ba88543 commit 4eaec31
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ public String appleLoginPage(ModelMap model) {
model.addAttribute("redirect_uri", metaInfo.get("REDIRECT_URI"));
model.addAttribute("nonce", metaInfo.get("NONCE"));

System.out.println(model.getAttribute("client_id"));
System.out.println(model.getAttribute("redirect_uri"));
System.out.println(model.getAttribute("nonce"));


return "index";
}

Expand All @@ -62,15 +57,6 @@ public String appleLogin(ModelMap model) {
model.addAttribute("scope", "name email");
model.addAttribute("response_mode", "form_post");

System.out.println("==========================");
System.out.println(model.getAttribute("client_id"));
System.out.println(model.getAttribute("redirect_uri"));
System.out.println(model.getAttribute("nonce"));
System.out.println(model.getAttribute("response_type"));
System.out.println(model.getAttribute("scope"));
System.out.println(model.getAttribute("response_mode"));


return "redirect:https://appleid.apple.com/auth/authorize";
}

Expand All @@ -84,10 +70,14 @@ public String appleLogin(ModelMap model) {
@ResponseBody
public TokenResponse servicesRedirect(ServicesResponse serviceResponse) {

System.out.println("1------------");

if (serviceResponse == null) {
return null;
}

System.out.println("2------------");

String code = serviceResponse.getCode();
String client_secret = appleService.getAppleClientSecret(serviceResponse.getId_token());

Expand All @@ -97,6 +87,8 @@ public TokenResponse servicesRedirect(ServicesResponse serviceResponse) {
logger.debug("client_secret ‣ " + client_secret);
logger.debug("================================");

System.out.println("3------------");

return appleService.requestCodeValidations(client_secret, code, null);
}

Expand Down
6 changes: 3 additions & 3 deletions server/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ logging.level.com.whitepaek.demosigninwithapple=DEBUG

APPLE.AUTH.TOKEN.URL=https://appleid.apple.com/auth/token
APPLE.PUBLICKEY.URL=https://appleid.apple.com/auth/keys
# redirect url 정보
# redirect url ??
APPLE.WEBSITE.URL=https://yogit.world/redirect
APPLE.ISS=https://appleid.apple.com
# client_ID
APPLE.AUD=com.Branch.service
#Team_ID
APPLE.TEAM.ID=9487SKDZZB
# kid
APPLE.KEY.ID=W6WcOKB
APPLE.KEY.ID=QLHFNT37VK
# key id path : AuthKey_[key_id]
APPLE.KEY.PATH=static/AuthKey_W6WcOKB.p8
APPLE.KEY.PATH=static/AuthKey_QLHFNT37VK.p8
4 changes: 3 additions & 1 deletion server/src/main/resources/static/AuthKey_[KeyID].p8
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
-----BEGIN PRIVATE KEY-----
### String ###
-----END PRIVATE KEY-----
fh6Bs8C
-----END PRIVATE KEY-----
QLHFNT37VK

0 comments on commit 4eaec31

Please sign in to comment.