Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: YAPP-Github/23rd-Android-Team-2-BE
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: d55f31edcfddb8ddb06416acb24578aa6e7d428e
Choose a base ref
..
head repository: YAPP-Github/23rd-Android-Team-2-BE
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c475612aea6a1ff70368a787219baf7ff401d20c
Choose a head ref
Showing with 10 additions and 9 deletions.
  1. +10 −9 src/main/java/com/moneymong/global/security/oauth/handler/AppleService.java
Original file line number Diff line number Diff line change
@@ -34,10 +34,7 @@
import java.security.Security;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.Base64;
import java.util.Collections;
import java.util.Date;
import java.util.Map;
import java.util.*;

@Slf4j
@Component
@@ -126,7 +123,7 @@ public void unlink(Long userId) {
params.add("token_type_hint", "refresh_token");

URI uri = UriComponentsBuilder
.fromUriString(host + "/auth/revoke")
.fromUriString(host + "/auth/oauth2/v2/revoke")
.build()
.toUri();

@@ -144,15 +141,19 @@ public void unlink(Long userId) {
}

private String createClientSecret() {
ZonedDateTime expiration = ZonedDateTime.now().plusMinutes(5);
Date expirationDate = Date.from(ZonedDateTime.now().plusDays(30).toInstant());

Map<String, Object> jwtHeader = new HashMap<>();
jwtHeader.put(JwsHeader.KEY_ID, keyId);
jwtHeader.put(JwsHeader.ALGORITHM, "ES256");

return Jwts.builder()
.setHeaderParam(JwsHeader.KEY_ID, keyId)
.setHeaderParams(jwtHeader)
.setIssuer(teamId)
.setAudience(host)
.setSubject(clientId)
.setExpiration(Date.from(expiration.withZoneSameInstant(ZoneId.systemDefault()).toInstant()))
.setIssuedAt(new Date())
.setExpiration(expirationDate)
.setIssuedAt(new Date(System.currentTimeMillis()))
.signWith(getPrivateKey(), SignatureAlgorithm.ES256)
.compact();
}