토스 로그인 "연결 끊기 콜백"이 실제 토스 앱에서 연동 해제 시 발송되지 않습니다.

이 글의 성격은 무엇인가요?

질문 / 문제 해결

내용을 설명해주세요

[문제 상황]
토스 로그인 "연결 끊기 콜백"이 실제 토스 앱에서 연동 해제 시 발송되지 않습니다.

[테스트 결과]

  1. 콘솔 “테스트하기” 버튼 → :white_check_mark: 콜백 정상 수신 (200 OK)
  2. curl 직접 호출 → :white_check_mark: 콜백 정상 수신 (200 OK)
  3. 토스 앱 → 설정 → 인증 및 보안 → 토스로 로그인한 서비스 → 연결 끊기 → :cross_mark: 콜백 수신 안 됨

[확인 사항]

  • 콘솔에서 콜백 URL, HTTP 메서드(GET), Basic Auth 모두 정상 설정됨
  • 서버 CORS 전체 허용(*)으로 설정해도 동일한 현상
  • 서버 로그에 실제 연동 해제 시 콜백 요청 흔적이 전혀 없음

[질문]
콘솔 테스트는 성공하는데 실제 앱 연동 해제 시 콜백이 발송되는 게 맞나요?

[개발 환경]

  • WebView (React + Vite)
  • @apps-in-toss/web-framework 1.x
  • 실제 런칭 환경 (프로덕션)

appName (선택)

kkoma-studio

@1341 님 안녕하세요

콘솔에서 ‘테스트하기’ 버튼을 통해서는 정상 호출 받으셨는데,

앱에서 진행 시에만 오류가 발생한 것으로 인지했습니다.

오늘 16:27 로그 확인해보니 400에러 발생하는 것으로 보이는데 내부 서버 이슈 없는지 확인 부탁드립니다.

저희 서버 로그를 확인한 결과:

  1. 16:27 시간대에 unlink-callback 요청이 저희 서버에 도달한 기록이 없습니다
  2. 24시간 내 400 에러 기록도 없습니다 (401만 존재)
  3. 콘솔의 “테스트하기” 버튼으로 호출한 요청은 모두 200 성공 응답입니다
  4. curl로 직접 테스트해도 정상 동작합니다

서버 설정도 확인했습니다:

  • CORS 전체 허용
  • ingress 외부 트래픽 허용
  • IAM 인증 없이 접근 가능

저희 서버에서 막고 있는 것이 없는 상황입니다.

확인 부탁드리는 사항:

  1. 토스 측에서 호출하는 URL이 콘솔에 등록된 URL과 일치하는지
  2. 400 에러가 토스 내부 게이트웨이에서 발생하는 것은 아닌지
  3. 앱에서 연동 해제 시 콜백이 실제로 발송되는지
GET https://kkoma-studio-backend-h3rfz4sldq-du.a.run.app/v1/auth/toss/unlink-callback?userKey=????&referrer=UNLINK

다음과 같이 호출한 이력이 있고 400 에러 받고 있습니다.

혹시 400 응답의 body 내용을 확인해주실 수 있을까요? 저희 서버가 400을 반환할 경우 {“error”: “userKey is required”} 형식으로 응답하는데, 다른 형식이라면 중간 경로에서 발생한 에러일 수 있습니다.

저희가 따로 응답을 로깅하고 있지 않아 확인이 어렵습니다 :bow:

같은 url로 curl 요청 한번 드릴까요?

네, 부탁드립니다.

아래처럼 요청했고 정상 응답 받네요.

 curl -X GET https://kkoma-studio-backend-h3rfz4sldq-du.a.run.app/v1/auth/toss/unlink-callback\?userKey\=???\&referrer\=UNLINK -H 'Accept: */*' -H 'Authorization: Basic ???'
{"success":true}

curl과 콘솔 테스트는 정상인데 실제 앱 연동 해제 시에만 400 에러가 발생한다면, 앱에서 콜백을 발송하는 경로나 방식이 다른 것 같습니다. 토스 내부적으로 앱 연동 해제 시 콜백 발송 로직 확인 부탁드려도 될까요?

원인은 식별했습니다. cloud run 사용 중이신 것 같은데 아래처럼 data가 요청에 있으면 에러가 나네요.

내부적으로 GET요청 시 data payload 제거해도 될지 검토해볼게요.

 curl -X GET https://kkoma-studio-backend-h3rfz4sldq-du.a.run.app/v1/auth/toss/unlink-callback\?userKey\=???\&referrer\=UNLINK -H 'Accept: */*' -H 'Authorization: Basic ???' -d '{}'
<!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 400 (Bad Request)!!1</title>
  <style>
    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
  </style>
  <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
  <p><b>400.</b> <ins>That’s an error.</ins>
  <p>Your client has issued a malformed or illegal request.  <ins>That’s all we know.</ins>

그럼 연동해제 이슈로 계속 반려당하고 있는건 그때까지 기다려야할까요?

빠르게 검토하기는 할텐데 콜백을 POST 요청으로 변경하실 수는 없을까요?

변경해보도록 하겠습니다.

POST 변경하였으며, curl test 성공하였습니다.

우선 불편드려 죄송하고, POST로 변경해주셔서 감사합니다. GET 요청 시 -d ‘{}’ 로 요청 가던 부분은 수정 반영되었습니다

1개의 좋아요