카카오 결제 api 질문이요

안녕하세요 도움을 좀 구해보ㅏ요

approve 요청할 때 아래처럼 필요한건 다 보냈다고 생각했습니다

header :
[Authorization:"KakaoAK 9d0a458b987ea7c9d2180dd705393b9d", Content-type:"application/x-www-form-urlencoded;charset=utf-8"]

body : 
[cid:"TC0ONETIME", tid:"T3a3c6494a466e29b521", partner_order_id:"홍길동", partner_user_id:"홍길동", pg_token:"5c78f918bab62c80c73b"]

근데 아래 처럼 권한을 인증하려면 정보가 더 필요하다는데 어떤 실수가 있었을까요

오류내용 :

e[2m2022-12-22 11:52:10.448e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36mo.a.h.client.protocol.RequestAddCookies e[0;39m e[2m:e[0;39m CookieSpec selected: default
e[2m2022-12-22 11:52:10.451e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36mo.a.h.client.protocol.RequestAuthCache  e[0;39m e[2m:e[0;39m Auth cache not set in the context
e[2m2022-12-22 11:52:10.451e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36mh.i.c.PoolingHttpClientConnectionManagere[0;39m e[2m:e[0;39m Connection request: [route: {s}->https://kapi.kakao.com:443][total available: 0; route allocated: 0 of 5; total allocated: 0 of 10]
e[2m2022-12-22 11:52:10.456e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36mh.i.c.PoolingHttpClientConnectionManagere[0;39m e[2m:e[0;39m Connection leased: [id: 0][route: {s}->https://kapi.kakao.com:443][total available: 0; route allocated: 1 of 5; total allocated: 1 of 10]
e[2m2022-12-22 11:52:10.456e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36mo.a.http.impl.execchain.MainClientExec  e[0;39m e[2m:e[0;39m Opening connection {s}->https://kapi.kakao.com:443
e[2m2022-12-22 11:52:10.457e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36m.i.c.DefaultHttpClientConnectionOperatore[0;39m e[2m:e[0;39m Connecting to kapi.kakao.com/27.0.237.16:443
e[2m2022-12-22 11:52:10.457e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36mo.a.h.c.ssl.SSLConnectionSocketFactory  e[0;39m e[2m:e[0;39m Connecting socket to kapi.kakao.com/27.0.237.16:443 with timeout 0
e[2m2022-12-22 11:52:10.471e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36mo.a.h.c.ssl.SSLConnectionSocketFactory  e[0;39m e[2m:e[0;39m Enabled protocols: [TLSv1.3, TLSv1.2]
e[2m2022-12-22 11:52:10.471e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36mo.a.h.c.ssl.SSLConnectionSocketFactory  e[0;39m e[2m:e[0;39m Enabled cipher suites:[TLS_AES_256_GCM_SHA384, TLS_AES_128_GCM_SHA256, TLS_CHACHA20_POLY1305_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256, TLS_DHE_DSS_WITH_AES_256_GCM_SHA384, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_EMPTY_RENEGOTIATION_INFO_SCSV]
e[2m2022-12-22 11:52:10.471e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36mo.a.h.c.ssl.SSLConnectionSocketFactory  e[0;39m e[2m:e[0;39m Starting handshake
e[2m2022-12-22 11:52:10.487e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36mo.a.h.c.ssl.SSLConnectionSocketFactory  e[0;39m e[2m:e[0;39m Secure session established
e[2m2022-12-22 11:52:10.487e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36mo.a.h.c.ssl.SSLConnectionSocketFactory  e[0;39m e[2m:e[0;39m  negotiated protocol: TLSv1.3
e[2m2022-12-22 11:52:10.487e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36mo.a.h.c.ssl.SSLConnectionSocketFactory  e[0;39m e[2m:e[0;39m  negotiated cipher suite: TLS_AES_256_GCM_SHA384
e[2m2022-12-22 11:52:10.488e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36mo.a.h.c.ssl.SSLConnectionSocketFactory  e[0;39m e[2m:e[0;39m  peer principal: CN=*.kakao.com, O=Kakao Corp., L=Jeju-si, ST=Jeju-do, C=KR
e[2m2022-12-22 11:52:10.488e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36mo.a.h.c.ssl.SSLConnectionSocketFactory  e[0;39m e[2m:e[0;39m  peer alternative names: [*.kakao.com, kakao.com]
e[2m2022-12-22 11:52:10.488e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36mo.a.h.c.ssl.SSLConnectionSocketFactory  e[0;39m e[2m:e[0;39m  issuer principal: CN=Thawte TLS RSA CA G1, OU=www.digicert.com, O=DigiCert Inc, C=US
e[2m2022-12-22 11:52:10.489e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36m.i.c.DefaultHttpClientConnectionOperatore[0;39m e[2m:e[0;39m Connection established 192.168.7.59:50625<->27.0.237.16:443
e[2m2022-12-22 11:52:10.489e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36mo.a.http.impl.execchain.MainClientExec  e[0;39m e[2m:e[0;39m Executing request POST /v1/payment/approve HTTP/1.1
e[2m2022-12-22 11:52:10.489e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36mo.a.http.impl.execchain.MainClientExec  e[0;39m e[2m:e[0;39m Target auth state: UNCHALLENGED
e[2m2022-12-22 11:52:10.489e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36mo.a.http.impl.execchain.MainClientExec  e[0;39m e[2m:e[0;39m Proxy auth state: UNCHALLENGED
e[2m2022-12-22 11:52:10.490e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.headers                 e[0;39m e[2m:e[0;39m http-outgoing-0 >> POST /v1/payment/approve HTTP/1.1
e[2m2022-12-22 11:52:10.490e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.headers                 e[0;39m e[2m:e[0;39m http-outgoing-0 >> Accept: application/json, application/*+json
e[2m2022-12-22 11:52:10.490e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.headers                 e[0;39m e[2m:e[0;39m http-outgoing-0 >> cid: TC0ONETIME
e[2m2022-12-22 11:52:10.490e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.headers                 e[0;39m e[2m:e[0;39m http-outgoing-0 >> tid: T3a3c6494a466e29b521
e[2m2022-12-22 11:52:10.490e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.headers                 e[0;39m e[2m:e[0;39m http-outgoing-0 >> partner_order_id: 홍길동
e[2m2022-12-22 11:52:10.490e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.headers                 e[0;39m e[2m:e[0;39m http-outgoing-0 >> partner_user_id: 홍길동
e[2m2022-12-22 11:52:10.490e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.headers                 e[0;39m e[2m:e[0;39m http-outgoing-0 >> pg_token: 5c78f918bab62c80c73b
e[2m2022-12-22 11:52:10.490e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.headers                 e[0;39m e[2m:e[0;39m http-outgoing-0 >> Content-Type: application/x-www-form-urlencoded;charset=UTF-8
e[2m2022-12-22 11:52:10.490e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.headers                 e[0;39m e[2m:e[0;39m http-outgoing-0 >> Content-Length: 121
e[2m2022-12-22 11:52:10.490e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.headers                 e[0;39m e[2m:e[0;39m http-outgoing-0 >> Host: kapi.kakao.com
e[2m2022-12-22 11:52:10.490e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.headers                 e[0;39m e[2m:e[0;39m http-outgoing-0 >> Connection: Keep-Alive
e[2m2022-12-22 11:52:10.490e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.headers                 e[0;39m e[2m:e[0;39m http-outgoing-0 >> User-Agent: Apache-HttpClient/4.5.11 (Java/11.0.16.1)
e[2m2022-12-22 11:52:10.490e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.headers                 e[0;39m e[2m:e[0;39m http-outgoing-0 >> Accept-Encoding: gzip,deflate
e[2m2022-12-22 11:52:10.490e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.wire                    e[0;39m e[2m:e[0;39m http-outgoing-0 >> "POST /v1/payment/approve HTTP/1.1[\r][\n]"
e[2m2022-12-22 11:52:10.490e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.wire                    e[0;39m e[2m:e[0;39m http-outgoing-0 >> "Accept: application/json, application/*+json[\r][\n]"
e[2m2022-12-22 11:52:10.490e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.wire                    e[0;39m e[2m:e[0;39m http-outgoing-0 >> "cid: TC0ONETIME[\r][\n]"
e[2m2022-12-22 11:52:10.490e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.wire                    e[0;39m e[2m:e[0;39m http-outgoing-0 >> "tid: T3a3c6494a466e29b521[\r][\n]"
e[2m2022-12-22 11:52:10.490e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.wire                    e[0;39m e[2m:e[0;39m http-outgoing-0 >> "partner_order_id: M8[0xd9][\r][\n]"
e[2m2022-12-22 11:52:10.490e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.wire                    e[0;39m e[2m:e[0;39m http-outgoing-0 >> "partner_user_id: M8[0xd9][\r][\n]"
e[2m2022-12-22 11:52:10.490e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.wire                    e[0;39m e[2m:e[0;39m http-outgoing-0 >> "pg_token: 5c78f918bab62c80c73b[\r][\n]"
e[2m2022-12-22 11:52:10.490e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.wire                    e[0;39m e[2m:e[0;39m http-outgoing-0 >> "Content-Type: application/x-www-form-urlencoded;charset=UTF-8[\r][\n]"
e[2m2022-12-22 11:52:10.490e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.wire                    e[0;39m e[2m:e[0;39m http-outgoing-0 >> "Content-Length: 121[\r][\n]"
e[2m2022-12-22 11:52:10.490e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.wire                    e[0;39m e[2m:e[0;39m http-outgoing-0 >> "Host: kapi.kakao.com[\r][\n]"
e[2m2022-12-22 11:52:10.490e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.wire                    e[0;39m e[2m:e[0;39m http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
e[2m2022-12-22 11:52:10.491e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.wire                    e[0;39m e[2m:e[0;39m http-outgoing-0 >> "User-Agent: Apache-HttpClient/4.5.11 (Java/11.0.16.1)[\r][\n]"
e[2m2022-12-22 11:52:10.491e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.wire                    e[0;39m e[2m:e[0;39m http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]"
e[2m2022-12-22 11:52:10.491e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.wire                    e[0;39m e[2m:e[0;39m http-outgoing-0 >> "[\r][\n]"
e[2m2022-12-22 11:52:10.491e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.wire                    e[0;39m e[2m:e[0;39m http-outgoing-0 >> "Authorization=KakaoAK+9d0a458b987ea7c9d2180dd705393b9d&Content-type=application%2Fx-www-form-urlencoded%3Bcharset%3Dutf-8"
e[2m2022-12-22 11:52:10.504e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.wire                    e[0;39m e[2m:e[0;39m http-outgoing-0 << "HTTP/1.1 401 Unauthorized[\r][\n]"
e[2m2022-12-22 11:52:10.504e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.wire                    e[0;39m e[2m:e[0;39m http-outgoing-0 << "Date: Thu, 22 Dec 2022 02:52:10 GMT[\r][\n]"
e[2m2022-12-22 11:52:10.504e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.wire                    e[0;39m e[2m:e[0;39m http-outgoing-0 << "Server: Apache[\r][\n]"
e[2m2022-12-22 11:52:10.504e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.wire                    e[0;39m e[2m:e[0;39m http-outgoing-0 << "Access-Control-Allow-Origin: *[\r][\n]"
e[2m2022-12-22 11:52:10.504e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.wire                    e[0;39m e[2m:e[0;39m http-outgoing-0 << "Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS[\r][\n]"
e[2m2022-12-22 11:52:10.504e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.wire                    e[0;39m e[2m:e[0;39m http-outgoing-0 << "Access-Control-Allow-Headers: Content-Type,X-Requested-With,Accept,Authorization,Origin,KA,Cache-Control,Pragma[\r][\n]"
e[2m2022-12-22 11:52:10.504e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.wire                    e[0;39m e[2m:e[0;39m http-outgoing-0 << "X-Request-ID: 07040a8d-9fef-44f5-a931-600e58ada26e[\r][\n]"
e[2m2022-12-22 11:52:10.504e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.wire                    e[0;39m e[2m:e[0;39m http-outgoing-0 << "WWW-Authenticate: error=invalid_token[\r][\n]"
e[2m2022-12-22 11:52:10.504e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.wire                    e[0;39m e[2m:e[0;39m http-outgoing-0 << "Content-Type: application/json;charset=UTF-8[\r][\n]"
e[2m2022-12-22 11:52:10.504e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.wire                    e[0;39m e[2m:e[0;39m http-outgoing-0 << "Content-Length: 59[\r][\n]"
e[2m2022-12-22 11:52:10.504e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.wire                    e[0;39m e[2m:e[0;39m http-outgoing-0 << "Keep-Alive: timeout=10, max=500[\r][\n]"
e[2m2022-12-22 11:52:10.504e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.wire                    e[0;39m e[2m:e[0;39m http-outgoing-0 << "Connection: Keep-Alive[\r][\n]"
e[2m2022-12-22 11:52:10.504e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.wire                    e[0;39m e[2m:e[0;39m http-outgoing-0 << "[\r][\n]"
e[2m2022-12-22 11:52:10.504e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.wire                    e[0;39m e[2m:e[0;39m http-outgoing-0 << "{"msg":"need more information to authenticate","code":-401}"
e[2m2022-12-22 11:52:10.505e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.headers                 e[0;39m e[2m:e[0;39m http-outgoing-0 << HTTP/1.1 401 Unauthorized
e[2m2022-12-22 11:52:10.505e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.headers                 e[0;39m e[2m:e[0;39m http-outgoing-0 << Date: Thu, 22 Dec 2022 02:52:10 GMT
e[2m2022-12-22 11:52:10.505e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.headers                 e[0;39m e[2m:e[0;39m http-outgoing-0 << Server: Apache
e[2m2022-12-22 11:52:10.505e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.headers                 e[0;39m e[2m:e[0;39m http-outgoing-0 << Access-Control-Allow-Origin: *
e[2m2022-12-22 11:52:10.505e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.headers                 e[0;39m e[2m:e[0;39m http-outgoing-0 << Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
e[2m2022-12-22 11:52:10.505e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.headers                 e[0;39m e[2m:e[0;39m http-outgoing-0 << Access-Control-Allow-Headers: Content-Type,X-Requested-With,Accept,Authorization,Origin,KA,Cache-Control,Pragma
e[2m2022-12-22 11:52:10.505e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.headers                 e[0;39m e[2m:e[0;39m http-outgoing-0 << X-Request-ID: 07040a8d-9fef-44f5-a931-600e58ada26e
e[2m2022-12-22 11:52:10.505e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.headers                 e[0;39m e[2m:e[0;39m http-outgoing-0 << WWW-Authenticate: error=invalid_token
e[2m2022-12-22 11:52:10.505e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.headers                 e[0;39m e[2m:e[0;39m http-outgoing-0 << Content-Type: application/json;charset=UTF-8
e[2m2022-12-22 11:52:10.505e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.headers                 e[0;39m e[2m:e[0;39m http-outgoing-0 << Content-Length: 59
e[2m2022-12-22 11:52:10.505e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.headers                 e[0;39m e[2m:e[0;39m http-outgoing-0 << Keep-Alive: timeout=10, max=500
e[2m2022-12-22 11:52:10.505e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36morg.apache.http.headers                 e[0;39m e[2m:e[0;39m http-outgoing-0 << Connection: Keep-Alive
e[2m2022-12-22 11:52:10.507e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36mo.a.http.impl.execchain.MainClientExec  e[0;39m e[2m:e[0;39m Connection can be kept alive for 10000 MILLISECONDS
e[2m2022-12-22 11:52:10.507e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36mo.a.http.impl.auth.HttpAuthenticator    e[0;39m e[2m:e[0;39m Authentication required
e[2m2022-12-22 11:52:10.507e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36mo.a.http.impl.auth.HttpAuthenticator    e[0;39m e[2m:e[0;39m kapi.kakao.com:443 requested authentication
e[2m2022-12-22 11:52:10.507e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36mo.a.h.i.c.TargetAuthenticationStrategy  e[0;39m e[2m:e[0;39m Authentication schemes in the order of preference: [Negotiate, Kerberos, NTLM, CredSSP, Digest, Basic]
e[2m2022-12-22 11:52:10.507e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36mo.a.h.i.c.TargetAuthenticationStrategy  e[0;39m e[2m:e[0;39m Challenge for Negotiate authentication scheme not available
e[2m2022-12-22 11:52:10.507e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36mo.a.h.i.c.TargetAuthenticationStrategy  e[0;39m e[2m:e[0;39m Challenge for Kerberos authentication scheme not available
e[2m2022-12-22 11:52:10.507e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36mo.a.h.i.c.TargetAuthenticationStrategy  e[0;39m e[2m:e[0;39m Challenge for NTLM authentication scheme not available
e[2m2022-12-22 11:52:10.507e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36mo.a.h.i.c.TargetAuthenticationStrategy  e[0;39m e[2m:e[0;39m Challenge for CredSSP authentication scheme not available
e[2m2022-12-22 11:52:10.507e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36mo.a.h.i.c.TargetAuthenticationStrategy  e[0;39m e[2m:e[0;39m Challenge for Digest authentication scheme not available
e[2m2022-12-22 11:52:10.507e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36mo.a.h.i.c.TargetAuthenticationStrategy  e[0;39m e[2m:e[0;39m Challenge for Basic authentication scheme not available
e[2m2022-12-22 11:52:10.509e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36mh.i.c.PoolingHttpClientConnectionManagere[0;39m e[2m:e[0;39m Connection [id: 0][route: {s}->https://kapi.kakao.com:443] can be kept alive for 10.0 seconds
e[2m2022-12-22 11:52:10.509e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36mh.i.c.DefaultManagedHttpClientConnectione[0;39m e[2m:e[0;39m http-outgoing-0: set socket timeout to 0
e[2m2022-12-22 11:52:10.509e[0;39m e[32mDEBUGe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36mh.i.c.PoolingHttpClientConnectionManagere[0;39m e[2m:e[0;39m Connection released: [id: 0][route: {s}->https://kapi.kakao.com:443][total available: 1; route allocated: 1 of 5; total allocated: 1 of 10]
e[2m2022-12-22 11:52:10.515e[0;39m e[31mERRORe[0;39m e[35m42236e[0;39m e[2m---e[0;39m e[2m[nio-9090-exec-6]e[0;39m e[36mo.a.c.c.C.[.[.[/].[dispatcherServlet]   e[0;39m e[2m:e[0;39m Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.web.client.HttpClientErrorException$Unauthorized: 401 Unauthorized: "{"msg":"need more information to authenticate","code":-401}"] with root cause

코드

public ApproveRes payApprove(String tid, String pgToken) {
		
		RestTemplate rt = new RestTemplate();
		rt.setRequestFactory(new HttpComponentsClientHttpRequestFactory());
		
		// header
		HttpHeaders headers = new HttpHeaders();
		headers.add("Authorization", "KakaoAK 9d0a458b987ea7c9d2180dd705393b9d");
		headers.add("Content-type", "application/x-www-form-urlencoded;charset=utf-8");
		// body
		MultiValueMap<String, String> params = new LinkedMultiValueMap<>();
		params.add("cid", "TC0ONETIME");
		params.add("tid", tid);
		params.add("partner_order_id", username);
		params.add("partner_user_id", username);
		params.add("pg_token", pgToken);
		
		
		System.out.println(username);
		System.out.println(tid);
		System.out.println(pgToken);
		
		HttpEntity<MultiValueMap<String, String>> requestEntity = new HttpEntity<>(headers, params);
		System.out.println(requestEntity.getBody());
		System.out.println(requestEntity.getHeaders());
		
        
		String url = "https://kapi.kakao.com/v1/payment/approve";
        // 보낼 외부 url, 요청 메시지(header,parameter), 처리후 값을 받아올 클래스. 
		ApproveRes response = rt.postForObject(url,
				requestEntity, ApproveRes.class);
		
		System.out.println(response);   // <- 여기서 오류 남
		
		
		return null;
	}

안녕하세요. 카카오페이 기술지원입니다.
문의주신 내용상으로 어떠한 문제인지는 카카오페이에서 안내드리기 어려운점 양해부탁드립니다.
카카오페이 api 호출시 유입되었는지 체크를 하기위해
request 데이터 (TID 포함) 및 요청일시 등 정보를 알려주시면 유입여부 안내드리도록 하겠습니다.
감사합니다.