From 855f0b0a0ec45965401b01619448d8e376c2c1af Mon Sep 17 00:00:00 2001 From: JaeSeo Yang <96044622+psychology50@users.noreply.github.com> Date: Wed, 10 Apr 2024 20:46:57 +0900 Subject: [PATCH 1/6] =?UTF-8?q?fix:=20=EA=B3=B5=EA=B0=9C=ED=82=A4=20?= =?UTF-8?q?=EC=84=9C=EB=AA=85=20=EA=B2=80=EC=A6=9D=20=EB=A9=94=EC=84=9C?= =?UTF-8?q?=EB=93=9C=EC=97=90=EC=84=9C=20token=20=EB=A1=9C=EA=B7=B8=20?= =?UTF-8?q?=EC=B6=9C=EB=A0=A5=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kr/co/pennyway/infra/common/oidc/OauthOidcProviderImpl.java | 1 - 1 file changed, 1 deletion(-) diff --git a/pennyway-infra/src/main/java/kr/co/pennyway/infra/common/oidc/OauthOidcProviderImpl.java b/pennyway-infra/src/main/java/kr/co/pennyway/infra/common/oidc/OauthOidcProviderImpl.java index 7b4244431..d9858f444 100644 --- a/pennyway-infra/src/main/java/kr/co/pennyway/infra/common/oidc/OauthOidcProviderImpl.java +++ b/pennyway-infra/src/main/java/kr/co/pennyway/infra/common/oidc/OauthOidcProviderImpl.java @@ -89,7 +89,6 @@ private String getUnsignedToken(String token) { */ private Jws getOIDCTokenJws(String token, String modulus, String exponent) { try { - log.info("token : {}", token); return Jwts.parser() .verifyWith(getRSAPublicKey(modulus, exponent)) .build() From beb9a32c642537ae0d0831678bfb95f5963ca616 Mon Sep 17 00:00:00 2001 From: JaeSeo Yang <96044622+psychology50@users.noreply.github.com> Date: Wed, 10 Apr 2024 20:58:22 +0900 Subject: [PATCH 2/6] =?UTF-8?q?fix:=20oauth=20oidc=20client=20properties?= =?UTF-8?q?=20=EC=9D=B8=ED=84=B0=ED=8E=98=EC=9D=B4=EC=8A=A4=20get=20issuer?= =?UTF-8?q?=20=EB=A9=94=EC=84=9C=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../infra/common/oidc/OauthOidcClientProperties.java | 2 ++ .../infra/common/properties/AppleOidcProperties.java | 5 +++++ .../infra/common/properties/GoogleOidcProperties.java | 1 + .../infra/common/properties/KakaoOidcProperties.java | 5 +++++ 4 files changed, 13 insertions(+) diff --git a/pennyway-infra/src/main/java/kr/co/pennyway/infra/common/oidc/OauthOidcClientProperties.java b/pennyway-infra/src/main/java/kr/co/pennyway/infra/common/oidc/OauthOidcClientProperties.java index 8b03875a6..dc6583d56 100644 --- a/pennyway-infra/src/main/java/kr/co/pennyway/infra/common/oidc/OauthOidcClientProperties.java +++ b/pennyway-infra/src/main/java/kr/co/pennyway/infra/common/oidc/OauthOidcClientProperties.java @@ -4,4 +4,6 @@ public interface OauthOidcClientProperties { String getJwksUri(); String getSecret(); + + String getIssuer(); } diff --git a/pennyway-infra/src/main/java/kr/co/pennyway/infra/common/properties/AppleOidcProperties.java b/pennyway-infra/src/main/java/kr/co/pennyway/infra/common/properties/AppleOidcProperties.java index d953b2285..4ad916da9 100644 --- a/pennyway-infra/src/main/java/kr/co/pennyway/infra/common/properties/AppleOidcProperties.java +++ b/pennyway-infra/src/main/java/kr/co/pennyway/infra/common/properties/AppleOidcProperties.java @@ -11,4 +11,9 @@ public class AppleOidcProperties implements OauthOidcClientProperties { private final String jwksUri; private final String secret; + + @Override + public String getIssuer() { + throw new UnsupportedOperationException("Not supported"); + } } diff --git a/pennyway-infra/src/main/java/kr/co/pennyway/infra/common/properties/GoogleOidcProperties.java b/pennyway-infra/src/main/java/kr/co/pennyway/infra/common/properties/GoogleOidcProperties.java index b61e61078..73cbfb070 100644 --- a/pennyway-infra/src/main/java/kr/co/pennyway/infra/common/properties/GoogleOidcProperties.java +++ b/pennyway-infra/src/main/java/kr/co/pennyway/infra/common/properties/GoogleOidcProperties.java @@ -11,4 +11,5 @@ public class GoogleOidcProperties implements OauthOidcClientProperties { private final String jwksUri; private final String secret; + private final String issuer; } diff --git a/pennyway-infra/src/main/java/kr/co/pennyway/infra/common/properties/KakaoOidcProperties.java b/pennyway-infra/src/main/java/kr/co/pennyway/infra/common/properties/KakaoOidcProperties.java index e7d3f90a2..fb65d7353 100644 --- a/pennyway-infra/src/main/java/kr/co/pennyway/infra/common/properties/KakaoOidcProperties.java +++ b/pennyway-infra/src/main/java/kr/co/pennyway/infra/common/properties/KakaoOidcProperties.java @@ -11,4 +11,9 @@ public class KakaoOidcProperties implements OauthOidcClientProperties { private final String jwksUri; private final String secret; + + @Override + public String getIssuer() { + throw new UnsupportedOperationException("Not supported"); + } } From bf7c7a05e34772d0826a8f90bc2fe5dde8ca5254 Mon Sep 17 00:00:00 2001 From: JaeSeo Yang <96044622+psychology50@users.noreply.github.com> Date: Wed, 10 Apr 2024 21:01:50 +0900 Subject: [PATCH 3/6] =?UTF-8?q?chore:=20infra=20=EB=AA=A8=EB=93=88=20provi?= =?UTF-8?q?der=20issuer=20=ED=99=98=EA=B2=BD=20=EB=B3=80=EC=88=98=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pennyway-infra/src/main/resources/application-infra.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pennyway-infra/src/main/resources/application-infra.yml b/pennyway-infra/src/main/resources/application-infra.yml index d71d5e076..01a155de0 100644 --- a/pennyway-infra/src/main/resources/application-infra.yml +++ b/pennyway-infra/src/main/resources/application-infra.yml @@ -28,14 +28,17 @@ oauth2: client: provider: kakao: - jwks-uri: ${KAKAO_JWKS_URI:https://kauth.kakao.com} + jwks-uri: ${KAKAO_JWKS_URI:https://kakao.com} secret: ${KAKAO_CLIENT_SECRET:liuhil5068l2j5o0912} + issuer: ${KAKAO_ISSUER:https://kakao} google: - jwks-uri: ${GOOGLE_JWKS_URI:https://www.googleapis.com} + jwks-uri: ${GOOGLE_JWKS_URI:https://google.com} secret: ${GOOGLE_CLIENT_SECRET:123456789012-67hm9vokrt6ukmiwtvd8ak67oflecm.apps.googleusercontent.com} + issuer: ${GOOGLE_ISSUER:https://google.com} apple: - jwks-uri: ${APPLE_JWKS_URI:https://appleid.apple.com} + jwks-uri: ${APPLE_JWKS_URI:https://apple.com} secret: ${APPLE_CLIENT_SECRET:pennyway-jayang-was} + issuer: ${APPLE_ISSUER:https://apple.com} --- spring: From bca49cc70c9f49812f4138745ee2beb98ab4f695 Mon Sep 17 00:00:00 2001 From: JaeSeo Yang <96044622+psychology50@users.noreply.github.com> Date: Wed, 10 Apr 2024 21:04:12 +0900 Subject: [PATCH 4/6] =?UTF-8?q?fix:=20apple,=20kakao=20=ED=99=98=EA=B2=BD?= =?UTF-8?q?=20get=20issuer=20=EB=A9=94=EC=84=9C=EB=93=9C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pennyway/infra/common/properties/AppleOidcProperties.java | 2 +- .../pennyway/infra/common/properties/KakaoOidcProperties.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pennyway-infra/src/main/java/kr/co/pennyway/infra/common/properties/AppleOidcProperties.java b/pennyway-infra/src/main/java/kr/co/pennyway/infra/common/properties/AppleOidcProperties.java index 4ad916da9..71a45aeaa 100644 --- a/pennyway-infra/src/main/java/kr/co/pennyway/infra/common/properties/AppleOidcProperties.java +++ b/pennyway-infra/src/main/java/kr/co/pennyway/infra/common/properties/AppleOidcProperties.java @@ -14,6 +14,6 @@ public class AppleOidcProperties implements OauthOidcClientProperties { @Override public String getIssuer() { - throw new UnsupportedOperationException("Not supported"); + return jwksUri; } } diff --git a/pennyway-infra/src/main/java/kr/co/pennyway/infra/common/properties/KakaoOidcProperties.java b/pennyway-infra/src/main/java/kr/co/pennyway/infra/common/properties/KakaoOidcProperties.java index fb65d7353..06d3b0f29 100644 --- a/pennyway-infra/src/main/java/kr/co/pennyway/infra/common/properties/KakaoOidcProperties.java +++ b/pennyway-infra/src/main/java/kr/co/pennyway/infra/common/properties/KakaoOidcProperties.java @@ -14,6 +14,6 @@ public class KakaoOidcProperties implements OauthOidcClientProperties { @Override public String getIssuer() { - throw new UnsupportedOperationException("Not supported"); + return jwksUri; } } From 1f7c408b583f3b7d2f23590c273cee95d976f649 Mon Sep 17 00:00:00 2001 From: JaeSeo Yang <96044622+psychology50@users.noreply.github.com> Date: Wed, 10 Apr 2024 21:04:32 +0900 Subject: [PATCH 5/6] =?UTF-8?q?chore:=20kakao,=20apple=20issuer=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pennyway-infra/src/main/resources/application-infra.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/pennyway-infra/src/main/resources/application-infra.yml b/pennyway-infra/src/main/resources/application-infra.yml index 01a155de0..3750504ed 100644 --- a/pennyway-infra/src/main/resources/application-infra.yml +++ b/pennyway-infra/src/main/resources/application-infra.yml @@ -30,7 +30,6 @@ oauth2: kakao: jwks-uri: ${KAKAO_JWKS_URI:https://kakao.com} secret: ${KAKAO_CLIENT_SECRET:liuhil5068l2j5o0912} - issuer: ${KAKAO_ISSUER:https://kakao} google: jwks-uri: ${GOOGLE_JWKS_URI:https://google.com} secret: ${GOOGLE_CLIENT_SECRET:123456789012-67hm9vokrt6ukmiwtvd8ak67oflecm.apps.googleusercontent.com} @@ -38,7 +37,6 @@ oauth2: apple: jwks-uri: ${APPLE_JWKS_URI:https://apple.com} secret: ${APPLE_CLIENT_SECRET:pennyway-jayang-was} - issuer: ${APPLE_ISSUER:https://apple.com} --- spring: From 63b2bd1e63310b98862c57b9cff91ac3f0a99fed Mon Sep 17 00:00:00 2001 From: JaeSeo Yang <96044622+psychology50@users.noreply.github.com> Date: Wed, 10 Apr 2024 21:12:43 +0900 Subject: [PATCH 6/6] =?UTF-8?q?fix:=20iss=20=EC=9D=B8=EC=9E=90=EC=97=90=20?= =?UTF-8?q?get=5Fjwks()=20->=20get=5Fissuer()=20=EB=A9=94=EC=84=9C?= =?UTF-8?q?=EB=93=9C=EB=A1=9C=20=EC=82=BD=EC=9E=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kr/co/pennyway/api/apis/auth/helper/OauthOidcHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pennyway-app-external-api/src/main/java/kr/co/pennyway/api/apis/auth/helper/OauthOidcHelper.java b/pennyway-app-external-api/src/main/java/kr/co/pennyway/api/apis/auth/helper/OauthOidcHelper.java index de6c777e1..eeccae84e 100644 --- a/pennyway-app-external-api/src/main/java/kr/co/pennyway/api/apis/auth/helper/OauthOidcHelper.java +++ b/pennyway-app-external-api/src/main/java/kr/co/pennyway/api/apis/auth/helper/OauthOidcHelper.java @@ -48,7 +48,7 @@ public OidcDecodePayload getPayload(Provider provider, String idToken) { OauthOidcClientProperties properties = oauthOidcClients.get(provider).values().iterator().next(); OidcPublicKeyResponse response = client.getOidcPublicKey(); - return getPayloadFromIdToken(idToken, properties.getJwksUri(), properties.getSecret(), null, response); + return getPayloadFromIdToken(idToken, properties.getIssuer(), properties.getSecret(), null, response); } /**