Twitter test-oauth-page-generated request_token curl return 401 unauthorized


#1

Hi,

I’m new to twitter development and am still testing the oauth.
I tried to directly execute the curl generated from the test oauth page with terminal, but it keeps giving me 401 unauthorized.

Settings:
Request type: POST
Request URI: https://api.twitter.com/oauth/request_token
Request query: oauth_callback=“oob”

Output:

  • Adding handle: conn: 0x7ff82280fe00
  • Adding handle: send: 0
  • Adding handle: recv: 0
  • Curl_addHandleToPipeline: length: 1
    • Conn 0 (0x7ff82280fe00) send_pipe: 1, recv_pipe: 0
  • About to connect() to api.twitter.com port 443 (#0)
  • Trying 199.59.150.9…
  • Connected to api.twitter.com (199.59.150.9) port 443 (#0)
  • TLS 1.2 connection using TLS_ECDHE_RSA_WITH_RC4_128_SHA
  • Server certificate: api.twitter.com
  • Server certificate: VeriSign Class 3 Secure Server CA - G3
  • Server certificate: VeriSign Class 3 Public Primary Certification Authority - G5

POST /oauth/request_token HTTP/1.1
User-Agent: curl/7.30.0
Host: api.twitter.com
Accept: /
Authorization: OAuth oauth_consumer_key=“MyEQHdrS4NySTeyV0EfNQ”, oauth_nonce=“ec94ec3fb735abe989c97530ac5ba0b4”, oauth_signature=“ylXYbAFlp8wzHVZSuKcEnV5FFkw%3D”, oauth_signature_method=“HMAC-SHA1”, oauth_timestamp=“1406119169”, oauth_token=“535019665-nXaY9ACOphTwZdrEaebRBVxBubRH5bvDOlrFND8a”, oauth_version="1.0"
Content-Length: 24
Content-Type: application/x-www-form-urlencoded

  • upload completely sent off: 24 out of 24 bytes
    < HTTP/1.1 401 Unauthorized
    < cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
    < content-length: 44
    < content-security-policy-report-only: default-src https:; connect-src https:; font-src https: data:; frame-src https: http://*.twimg.com http://itunes.apple.com about: javascript:; img-src https: data:; media-src https:; object-src https:; script-src ‘unsafe-inline’ ‘unsafe-eval’ about: https:; style-src ‘unsafe-inline’ https:; report-uri https://twitter.com/i/csp_report;
    < content-type: text/html; charset=utf-8
    < date: Wed, 23 Jul 2014 12:39:54 GMT
    < expires: Tue, 31 Mar 1981 05:00:00 GMT
    < last-modified: Wed, 23 Jul 2014 12:39:54 GMT
    < pragma: no-cache
  • Server tfe is not blacklisted
    < server: tfe
    < set-cookie: _twitter_sess=BAh7CDoHaWQiJTJiMjlmOTZlNzAwYzZhZDFmNzdjNTVlZjVlZDQxOGYxOg9j%250AcmVhdGVkX2F0bCsIai48Y0cBIgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVy%250AOjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA–9f30b7cd52fb291e1679b6b681c3a10c41d02acb; domain=.twitter.com; path=/; secure; HttpOnly
    < set-cookie: guest_id=v1%3A140611919421175305; Domain=.twitter.com; Path=/; Expires=Fri, 22-Jul-2016 12:39:54 UTC
    < status: 401 Unauthorized
    < strict-transport-security: max-age=631138519
    < vary: Accept-Encoding
    < x-content-type-options: nosniff
    < x-frame-options: SAMEORIGIN
    < x-mid: 156573b41807b8f5c29f9bc4e8ce48beacdc0f29
    < x-runtime: 0.01126
    < x-transaction: 3091a7ddfc93751f
    < x-ua-compatible: IE=edge,chrome=1
    < x-xss-protection: 1; mode=block
    <
  • Connection #0 to host api.twitter.com left intact

Thank you!