Skip to content

Commit

Permalink
#5 feat: 웹 말고 IOS에서로그인 테스트를 위해 servicesRedirectIosAPI 구현, fix: Team_I…
Browse files Browse the repository at this point in the history
…D 값 IOS용으로 수정"
  • Loading branch information
xhaktmchl committed Nov 17, 2022
1 parent 90cd82e commit 7e98818
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,32 +90,32 @@ public TokenResponse servicesRedirect(ServicesResponse serviceResponse) throws N
return appleService.requestCodeValidations(client_secret, code, null);
}

// /**
// * Apple Login 유저 정보를 받은 후 권한 생성
// * privateKey 로 사용자 개인 정보와 refreshToken 발급받기
// * @param serviceResponse
// * @return
// */
// @PostMapping(value = "/redirectios")
// @ResponseBody
// public TokenResponse servicesRedirectIos(ServicesResponse serviceResponse) throws NoSuchAlgorithmException {
//
// if (serviceResponse == null) {
// return null;
// }
//
// String code = serviceResponse.getCode();
// String id_token = serviceResponse.getId_token();
// String client_secret = appleService.getAppleClientSecret(serviceResponse.getId_token());
//
// logger.debug("================================");
// logger.debug("id_token ‣ " + serviceResponse.getId_token());
// logger.debug("payload ‣ " + appleService.getPayload(serviceResponse.getId_token()));
// logger.debug("client_secret ‣ " + client_secret);
// logger.debug("================================");
//
// return appleService.requestCodeValidations(client_secret, code, null);
// }
/**
* Apple Login 유저 정보를 받은 후 권한 생성
* privateKey 로 사용자 개인 정보와 refreshToken 발급받기
* @param serviceResponse
* @return
*/
@PostMapping(value = "/redirectios")
@ResponseBody
public TokenResponse servicesRedirectIos(ServicesResponse serviceResponse) throws NoSuchAlgorithmException {

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

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

logger.debug("================================");
logger.debug("id_token ‣ " + serviceResponse.getId_token());
logger.debug("payload ‣ " + appleService.getPayload(serviceResponse.getId_token()));
logger.debug("client_secret ‣ " + client_secret);
logger.debug("================================");

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

/**
* refresh_token 유효성 검사
Expand Down
4 changes: 2 additions & 2 deletions server/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ APPLE.PUBLICKEY.URL=https://appleid.apple.com/auth/keys
APPLE.WEBSITE.URL=https://yogit.world/redirect
APPLE.ISS=https://appleid.apple.com
# client_ID (Web 구현 용)
APPLE.AUD=com.Branch.service
#APPLE.AUD=com.Branch.service
# client_ID (IOS 구현 용)
#APPLE.AUD=com.Branch.Yogit
APPLE.AUD=com.Branch.Yogit
#Team_ID
APPLE.TEAM.ID=9487SKDZZB
# key_ID
Expand Down

0 comments on commit 7e98818

Please sign in to comment.