Skip to content

Commit

Permalink
hotfix: 애플로그인 이슈 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
CChuYong committed Aug 30, 2024
1 parent 91054af commit 1f31adb
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jws;
import io.jsonwebtoken.Jwts;
import java.security.interfaces.RSAPublicKey;
import java.util.Arrays;
import java.util.Base64;
import java.util.LinkedHashMap;
import java.util.Set;
import kr.mafoo.user.config.properties.AppleOAuthProperties;
import kr.mafoo.user.config.properties.KakaoOAuthProperties;
import kr.mafoo.user.controller.dto.response.AppleKeyListResponse;
Expand All @@ -24,11 +29,6 @@
import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.publisher.Mono;

import java.security.interfaces.RSAPublicKey;
import java.util.Arrays;
import java.util.Base64;
import java.util.LinkedHashMap;

@RequiredArgsConstructor
@Service
public class AuthService {
Expand Down Expand Up @@ -157,8 +157,8 @@ private Mono<AppleLoginInfo> getUserInfoWithAppleAccessToken(AppleKeyResponse[]
.build()
.parseSignedClaims(identityToken);

String client = claims.getPayload().get("aud", String.class);
if (!client.equals(appleOAuthProperties.clientId())) {
Set<String> audienceList = claims.getPayload().get("aud", Set.class);
if (audienceList == null || !audienceList.contains(appleOAuthProperties.clientId())) {
throw new RuntimeException();
}

Expand Down

0 comments on commit 1f31adb

Please sign in to comment.