From 86c4fe56008de2196ecec8bf2013d9770941976b Mon Sep 17 00:00:00 2001 From: DongGeon0908 Date: Tue, 30 Jul 2024 00:42:19 +0900 Subject: [PATCH] fix: authorized url --- .../kotlin/com/hero/alignlab/client/kakao/KakaoOAuthService.kt | 2 +- .../hero/alignlab/client/kakao/config/KakaoOAuthClientConfig.kt | 2 ++ src/main/resources/config/application.yml | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/com/hero/alignlab/client/kakao/KakaoOAuthService.kt b/src/main/kotlin/com/hero/alignlab/client/kakao/KakaoOAuthService.kt index 83938cd..d406dcd 100644 --- a/src/main/kotlin/com/hero/alignlab/client/kakao/KakaoOAuthService.kt +++ b/src/main/kotlin/com/hero/alignlab/client/kakao/KakaoOAuthService.kt @@ -14,7 +14,7 @@ class KakaoOAuthService( private val config: KakaoOAuthClientConfig.Config ) { suspend fun getOAuthLoginLinkDev(): String { - return config.url + "?client_id=${config.restApiKey}&redirect_uri=${config.redirectUrl}&response_type=code" + return config.url + String.format(config.redirectUrl, config.restApiKey, config.redirectUrl) } suspend fun getOAuthAuthorizeCode(redirectUrl: String? = null) { diff --git a/src/main/kotlin/com/hero/alignlab/client/kakao/config/KakaoOAuthClientConfig.kt b/src/main/kotlin/com/hero/alignlab/client/kakao/config/KakaoOAuthClientConfig.kt index 9d781e4..0d37170 100644 --- a/src/main/kotlin/com/hero/alignlab/client/kakao/config/KakaoOAuthClientConfig.kt +++ b/src/main/kotlin/com/hero/alignlab/client/kakao/config/KakaoOAuthClientConfig.kt @@ -46,5 +46,7 @@ class KakaoOAuthClientConfig { var clientSecretCode: String = "", @field:NotBlank var redirectUrl: String = "", + @field:NotBlank + var authorizedUrl: String = "", ) } diff --git a/src/main/resources/config/application.yml b/src/main/resources/config/application.yml index ed9cc5b..1342e15 100644 --- a/src/main/resources/config/application.yml +++ b/src/main/resources/config/application.yml @@ -53,6 +53,7 @@ oauth: rest-api-key: client-secret-code: # redirect url for get OAuth Authorize Code + authorized-url: /authorize?client_id=%s&redirect_uri=%s&response_type=code redirect-url: https://api.alignlab.site/api/dev/v1/oauth/kakao/token encrypt: