카카오 로그인 관련하여 문의드립니다.
메인 도메인(https://gguge.com)의 서브도메인(https://ai-test.gguge.com)을 사용하는 다른 서비스에서
메인 도메인 서버의 인증 로직을 그대로 사용하기 위해
다음과 같이 서브도메인 내부에 SDK를 사용하고
Kakao.Auth.authorize({
redirectUri: `https://gguge.com/api/kakaoAuth`,
state: JSON.stringify({
origin: window.location.origin,
}),
});
해당 도메인에서 로그인 요청이 완료되면, state에 포함한 정보를 이용하여 ai-test.gguge.com으로 리디렉션을 보내고 있는데,
KOE303 오류를 지속적으로 수신받습니다.
이런 식으로는 사용이 불가한가요?
요청 로그 첨부합니다.
GET 200 https://talk-apps.kakao.com/scheme/kakaotalk%3A%2F%2Finappbrowser%3Furl%3Dhttps%253A%252F%252Fkauth.kakao.com%252Foauth%252Fauthorize%253Fclient_id%253Dc499fed4281e404d08887142877f8eba%2526state%253D%25257B%252522origin%252522%25253A%252522https%25253A%25252F%25252Fai-test.gguge.com%252522%25257D%2526redirect_uri%253Dhttps%25253A%25252F%25252Fgguge.com%25252Fapi%25252FkakaoAuth%2526response_type%253Dcode%2526auth_tran_id%253D4h2k15yshfoc499fed4281e404d08887142877f8ebakvgepkfn%2526is_popup%253Dtrue%2526ka%253Dsdk%25252F1.40.14%252520os%25252Fjavascript%252520sdk_type%25252Fjavascript%252520lang%25252Fko-KR%252520device%25252FMacIntel%252520origin%25252Fhttps%2525253A%2525252F%2525252Fai-test.gguge.com&web=https%3A%2F%2Fkauth.kakao.com%2Foauth%2Fauthorize%3Fclient_id%3Dc499fed4281e404d08887142877f8eba%26state%3D%257B%2522origin%2522%253A%2522https%253A%252F%252Fai-test.gguge.com%2522%257D%26redirect_uri%3Dhttps%253A%252F%252Fgguge.com%252Fapi%252FkakaoAuth%26response_type%3Dcode%26auth_tran_id%3D4h2k15yshfoc499fed4281e404d08887142877f8ebakvgepkfn%26ka%3Dsdk%252F1.40.14%2520os%252Fjavascript%2520sdk_type%252Fjavascript%2520lang%252Fko-KR%2520device%252FMacIntel%2520origin%252Fhttps%25253A%25252F%25252Fai-test.gguge.com%26is_popup%3Dfalse
---
GET 302 https://kauth.kakao.com/oauth/authorize?client_id=c499fed4281e404d08887142877f8eba&state=%7B%22origin%22%3A%22https%3A%2F%2Fai-test.gguge.com%22%7D&redirect_uri=https%3A%2F%2Fgguge.com%2Fapi%2FkakaoAuth&response_type=code&auth_tran_id=4h2k15yshfoc499fed4281e404d08887142877f8ebakvgepkfn&ka=sdk%2F1.40.14%20os%2Fjavascript%20sdk_type%2Fjavascript%20lang%2Fko-KR%20device%2FMacIntel%20origin%2Fhttps%253A%252F%252Fai-test.gguge.com&is_popup=false
response.headers.location = https://gguge.com/api/kakaoAuth?code=lRd0ZhhVC_7VHQMfdaynmcYPGpSKVdxqtuOa1gQVWRxjAQMR150vyx_m8UpsPEv6EAViLQo9cxgAAAF82qMy1A&state=%7B%22origin%22%3A%22https%3A%2F%2Fai-test.gguge.com%22%7D
---
GET 302 https://gguge.com/api/kakaoAuth?code=lRd0ZhhVC_7VHQMfdaynmcYPGpSKVdxqtuOa1gQVWRxjAQMR150vyx_m8UpsPEv6EAViLQo9cxgAAAF82qMy1A&state=%7B%22origin%22%3A%22https%3A%2F%2Fai-test.gguge.com%22%7D
response.headers.location = https://ai-test.gguge.com/error?em=%EC%98%A4%EB%A5%98%EA%B0%80%20%EB%B0%9C%EC%83%9D%ED%96%88%EC%96%B4%EC%9A%94.%0A400:%7B%22error%22:%22invalid_grant%22,%22error_description%22:%22Redirect%20URI%20mismatch.%22,%22error_code%22:%22KOE303%22%7D