문의 시, 사용하시는 개발환경과 디벨로퍼스 앱ID를 알려주세요.
개발환경 : Spring Boot 2.5.0
디벨로퍼스 앱ID : 948338
IOS에서 SDK 를 통해 access token을 발급 받은 내용을 그대로, 서버에 전달후 /v2/user/me 엔드포인트를 호출하여 사용자 정보를 가져오는 형태입니다.
헤더와 Content-Type 다 확인했는데도, 401응답이 계속 떨어지고 있습니다. 토큰 역시 바로 발급받은 것을 사용했기에 만료 문제는 아닐것으로 사료됩니다.
아래는 RestTemplate을 통해 요청한 로그의 DEBUG 내용입니다.
[2023-10-03 18:36:12,292] [DEBUG] [o.a.h.wire Wire.java:73] http-outgoing-1 >> “GET /v2/user/me HTTP/1.1[\r][\n]”
[2023-10-03 18:36:12,292] [DEBUG] [o.a.h.wire Wire.java:73] http-outgoing-1 >> “Accept: application/json[\r][\n]”
[2023-10-03 18:36:12,292] [DEBUG] [o.a.h.wire Wire.java:73] http-outgoing-1 >> “Content-Type: application/x-www-form-urlencoded[\r][\n]”
[2023-10-03 18:36:12,292] [DEBUG] [o.a.h.wire Wire.java:73] http-outgoing-1 >> “Authorization: Bearer J_oGV9zBzJXIFdR7KoHqtdkZ****\r][\n]”
[2023-10-03 18:36:12,292] [DEBUG] [o.a.h.wire Wire.java:73] http-outgoing-1 >> “Host: kapi.kakao.com[\r][\n]”
[2023-10-03 18:36:12,292] [DEBUG] [o.a.h.wire Wire.java:73] http-outgoing-1 >> “Connection: Keep-Alive[\r][\n]”
[2023-10-03 18:36:12,292] [DEBUG] [o.a.h.wire Wire.java:73] http-outgoing-1 >> “User-Agent: Apache-HttpClient/4.5.13 (Java/15.0.7)[\r][\n]”
[2023-10-03 18:36:12,292] [DEBUG] [o.a.h.wire Wire.java:73] http-outgoing-1 >> “Accept-Encoding: gzip,deflate[\r][\n]”
[2023-10-03 18:36:12,293] [DEBUG] [o.a.h.wire Wire.java:73] http-outgoing-1 >> “[\r][\n]”
[2023-10-03 18:36:12,310] [DEBUG] [o.a.h.wire Wire.java:73] http-outgoing-1 << “HTTP/1.1 401 Unauthorized[\r][\n]”
[2023-10-03 18:36:12,310] [DEBUG] [o.a.h.wire Wire.java:73] http-outgoing-1 << “Date: Tue, 03 Oct 2023 09:36:12 GMT[\r][\n]”
[2023-10-03 18:36:12,310] [DEBUG] [o.a.h.wire Wire.java:73] http-outgoing-1 << “Server: Apache[\r][\n]”
[2023-10-03 18:36:12,310] [DEBUG] [o.a.h.wire Wire.java:73] http-outgoing-1 << “Access-Control-Allow-Origin: *[\r][\n]”
[2023-10-03 18:36:12,310] [DEBUG] [o.a.h.wire Wire.java:73] http-outgoing-1 << “Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS[\r][\n]”
[2023-10-03 18:36:12,310] [DEBUG] [o.a.h.wire Wire.java:73] http-outgoing-1 << “Access-Control-Allow-Headers: Content-Type,X-Requested-With,Accept,Authorization,Origin,KA,Cache-Control,Pragma[\r][\n]”
[2023-10-03 18:36:12,310] [DEBUG] [o.a.h.wire Wire.java:73] http-outgoing-1 << “X-Response-Cache: Hit[\r][\n]”
[2023-10-03 18:36:12,310] [DEBUG] [o.a.h.wire Wire.java:73] http-outgoing-1 << “X-Request-ID: 22873d98-f890-4e07-b5ec-8c6e8397cbd6[\r][\n]”
[2023-10-03 18:36:12,310] [DEBUG] [o.a.h.wire Wire.java:73] http-outgoing-1 << “WWW-Authenticate: Bearer error=invalid_token[\r][\n]”
[2023-10-03 18:36:12,311] [DEBUG] [o.a.h.wire Wire.java:73] http-outgoing-1 << “Content-Type: application/json;charset=UTF-8[\r][\n]”
[2023-10-03 18:36:12,311] [DEBUG] [o.a.h.wire Wire.java:73] http-outgoing-1 << “Content-Length: 54[\r][\n]”
[2023-10-03 18:36:12,311] [DEBUG] [o.a.h.wire Wire.java:73] http-outgoing-1 << “Keep-Alive: timeout=10, max=500[\r][\n]”
[2023-10-03 18:36:12,311] [DEBUG] [o.a.h.wire Wire.java:73] http-outgoing-1 << “Connection: Keep-Alive[\r][\n]”
[2023-10-03 18:36:12,311] [DEBUG] [o.a.h.wire Wire.java:73] http-outgoing-1 << “[\r][\n]”
[2023-10-03 18:36:12,311] [DEBUG] [o.a.h.wire Wire.java:87] http-outgoing-1 << “{“msg”:“this access token does not exist”,“code”:-401}”
토큰은 IOS에서 전달받은 그대로 잘 전달한 것 같은데, 뭐가 문제일까요?