안녕하세요?
nodejs page에서 redirect를 받아서 Auth Code까지는 받았는데 해당 Auth Code로 Access Token을 가져오면 아래와 같이 에러가 발생합니다. PostMan으로 Post를 날려도 동일한 에러가 발생합니다.
도움 부탁드립니다.
curl -v -X POST https://kauth.kakao.com/oauth/token \
-d ‘grant_type=authorization_code’
-d ‘client_id=xxxxxxxxxxxxxxxxxxxxxxxxxxx’
-d ‘redirect_uri=http://xxxxx.iptime.org:18080/oauth’
-d ‘code=WG_vfWRhDQGVTv9M-Kmz3GwGDohIRREoUM9Cpe_xPgUYN7wM8dAUcRr9Vsaj7x8XBBtyRgopdeIAAAFhEcCWjQ’
- About to connect() to kauth.kakao.com port 443 (#0)
- Trying 203.133.166.32…
- Connected to kauth.kakao.com (203.133.166.32) port 443 (#0)
- Initializing NSS with certpath: sql:/etc/pki/nssdb
- CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none - SSL connection using TLS_RSA_WITH_AES_128_GCM_SHA256
- Server certificate:
- subject: CN=*.kakao.com,O=Kakao Corp.,L=Jeju-si,ST=Jeju-do,C=KR
- start date: Oct 11 00:00:00 2017 GMT
- expire date: Dec 10 23:59:59 2018 GMT
- common name: *.kakao.com
- issuer: CN=thawte SSL CA - G2,O=“thawte, Inc.”,C=US
POST /oauth/token HTTP/1.1
User-Agent: curl/7.29.0
Host: kauth.kakao.com
Accept: /
Content-Length: 213
Content-Type: application/x-www-form-urlencoded
- upload completely sent off: 213 out of 213 bytes
< HTTP/1.1 401 Unauthorized
< Date: Sat, 20 Jan 2018 04:08:35 GMT
< Content-Type: application/json;charset=utf-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Cache-Control: no-store
< Pragma: no-cache
< WWW-Authenticate: Bearer realm=“oauth”, error=“invalid_client”, error_description=“Bad client credentials”
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Methods: GET, POST, OPTIONS
< Access-Control-Allow-Headers: Authorization, KA, Origin, X-Requested-With, Content-Type, Accept
< - Connection #0 to host kauth.kakao.com left intact
{“error”:“invalid_client”,“error_description”:“Bad client credentials”}