{"action":"created","issue":{"url":"https://api.github.com/repos/magento/magento2/issues/829","labels_url":"https://api.github.com/repos/magento/magento2/issues/829/labels{/name}","comments_url":"https://api.github.com/repos/magento/magento2/issues/829/comments","events_url":"https://api.github.com/repos/magento/magento2/issues/829/events","html_url":"https://github.com/magento/magento2/issues/829","id":52439379,"number":829,"title":"[API] OAuth1.0 request token request failing / Consumer key has expired","user":{"login":"nyov","id":438293,"avatar_url":"https://avatars.githubusercontent.com/u/438293?v=3","gravatar_id":"","url":"https://api.github.com/users/nyov","html_url":"https://github.com/nyov","followers_url":"https://api.github.com/users/nyov/followers","following_url":"https://api.github.com/users/nyov/following{/other_user}","gists_url":"https://api.github.com/users/nyov/gists{/gist_id}","starred_url":"https://api.github.com/users/nyov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nyov/subscriptions","organizations_url":"https://api.github.com/users/nyov/orgs","repos_url":"https://api.github.com/users/nyov/repos","events_url":"https://api.github.com/users/nyov/events{/privacy}","received_events_url":"https://api.github.com/users/nyov/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/magento/magento2/labels/bug","name":"bug","color":"eb6420"},{"url":"https://api.github.com/repos/magento/magento2/labels/PS","name":"PS","color":"fad8c7"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2014-12-19T01:49:38Z","updated_at":"2015-01-23T21:40:29Z","closed_at":"2015-01-23T21:40:29Z","body":"While trying to go the long route and get an OAuth1.0 request token via `POST /oauth/token/request` (as explained in [the devdocs](http://devdocs.magento.com/guides/v1.0/get-started/authentication/gs-authentication-oauth.html#pre-auth-token)) I'm having these issues.\r\n\r\nI tested these with both (and getting the same results)\r\n* a freshly created \"Integration\" without activating it (only Consumer Key & Secret exist)\r\n* an activated \"Integration\" (through the backend) with (unused) Accress Token & Secret\r\n\r\n**Variant 1, using POST body**:\r\n\r\nThe server returns a `HTTP/1.1 500 Internal Server Error`.\r\n\r\ntcpdump:\r\n```\r\nPOST /oauth/token/request HTTP/1.1\r\nHost: magento2.local\r\nContent-Length: 250\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nUser-Agent: python-requests/2.4.3 CPython/2.7.8\r\nConnection: keep-alive\r\ncontent-type: application/x-www-form-urlencoded\r\n\r\noauth_version=1.0&oauth_nonce=6b3dcfe588fcc4c6fceefdc10024a41d680f3779&oauth_timestamp=1418902037&oauth_signature=CdC6L9j8NWK6TZwCaI%2Fmevusqcg%3D&oauth_consumer_key=vdowjpsll6bmob27416mw0yx26a00obd&oauth_signature_method=HMAC-SHA1&oauth_callback=oob\r\n\r\nHTTP/1.1 500 Internal Server Error\r\nDate: Thu, 18 Dec 2014 11:27:17 GMT\r\nServer: Apache/2.4.10\r\nSet-Cookie: private_content_version=bd03c1e60f365f81666c2093da991bc0; expires=Sun, 15-Dec-2024 11:27:17 GMT; Max-Age=315360000; path=/\r\nSet-Cookie: PHPSESSID=vc9fsu4id7t8fuvia8jjrpa264; expires=Thu, 18-Dec-2014 12:27:17 GMT; Max-Age=3600; path=/; domain=magento2.local; HttpOnly\r\nSet-Cookie: X-Magento-Vary=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/\r\nPragma: no-cache\r\nCache-Control: no-store, no-cache, must-revalidate, max-age=0\r\nExpires: Wed, 18 Dec 2013 11:27:17 GMT\r\nConnection: close\r\nTransfer-Encoding: chunked\r\nContent-Type: text/html; charset=UTF-8\r\n\r\nd0\r\noauth_problem=internal_error%26message%3DNotice%3A+Undefined+index%3A+oauth_version+in+%2Fthis%2Fis%2Fsome%2Fprivate%2Fpath%2Fmagento2.git%2Flib%2Finternal%2FMagento%2FFramework%2FOauth%2FOauth.php+on+line+63\r\n0\r\n```\r\n\r\nUnquoted:\r\n`oauth_problem=internal_error&message=Notice:+Undefined+index:+oauth_version+in+/this/is/some/private/path/magento2.git/lib/internal/Magento/Framework/Oauth/Oauth.php+on+line+63`\r\n\r\nhttps://github.com/magento/magento2/blob/master/lib/internal/Magento/Framework/Oauth/Oauth.php#L63\r\nThat line checks for `$params['oauth_version']`, but as the dump should show the param is included.\r\n\r\nI concluded that Magento2 is now exclusively checking `Authorization` headers instead.\r\n\r\n**Variant 2, using Authorization Headers**:\r\n\r\nThe server returns a `HTTP/1.1 401 Unauthorized` message.\r\n\r\ntcpdump:\r\n```\r\nPOST /oauth/token/request HTTP/1.1\r\nHost: magento2.local\r\nContent-Length: 0\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nUser-Agent: python-requests/2.4.3 CPython/2.7.8\r\nConnection: keep-alive\r\ncontent-type: application/x-www-form-urlencoded\r\nAuthorization: OAuth realm=\"\",oauth_nonce=\"74b6b19dfc80aaa84bf4faf4c548b509cf92a71c\",oauth_timestamp=\"1418903145\",oauth_consumer_key=\"vxklyge1xp45q2o3afwyyjtg8ga15i58\",oauth_signature_method=\"HMAC-SHA1\",oauth_version=\"1.0\",oauth_signature=\"cA84%2Bt0O2ym3cVHE%2FdXz1Pwwn8E%3D\"\r\n\r\nHTTP/1.1 401 Unauthorized\r\nDate: Thu, 18 Dec 2014 11:45:45 GMT\r\nServer: Apache/2.4.10\r\nSet-Cookie: private_content_version=8a7cda19058a4697834d07a7c0f4c1d4; expires=Sun, 15-Dec-2024 11:45:45 GMT; Max-Age=315360000; path=/\r\nSet-Cookie: PHPSESSID=c9i34gpd023q8h37ogc9b6k0p4; expires=Thu, 18-Dec-2014 12:45:45 GMT; Max-Age=3600; path=/; domain=magento2.local; HttpOnly\r\nSet-Cookie: X-Magento-Vary=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/\r\nPragma: no-cache\r\nCache-Control: no-store, no-cache, must-revalidate, max-age=0\r\nExpires: Wed, 18 Dec 2013 11:45:45 GMT\r\nKeep-Alive: timeout=5, max=100\r\nConnection: Keep-Alive\r\nTransfer-Encoding: chunked\r\nContent-Type: text/html; charset=UTF-8\r\n\r\n26\r\noauth_problem=Consumer+key+has+expired\r\n0\r\n```\r\n\r\n(Consumer key has expired)\r\nThis seems to be the real issue here, the expiration time check.\r\n\r\nOf course I verified that I'm actually sending the consumer key&secret as displayed in the backend.\r\n\r\nAs an aside, the library used to build the OAuth requests is mature (and working with magento1)."},"comment":{"url":"https://api.github.com/repos/magento/magento2/issues/comments/71270697","html_url":"https://github.com/magento/magento2/issues/829#issuecomment-71270697","issue_url":"https://api.github.com/repos/magento/magento2/issues/829","id":71270697,"user":{"login":"muasir","id":593065,"avatar_url":"https://avatars.githubusercontent.com/u/593065?v=3","gravatar_id":"","url":"https://api.github.com/users/muasir","html_url":"https://github.com/muasir","followers_url":"https://api.github.com/users/muasir/followers","following_url":"https://api.github.com/users/muasir/following{/other_user}","gists_url":"https://api.github.com/users/muasir/gists{/gist_id}","starred_url":"https://api.github.com/users/muasir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muasir/subscriptions","organizations_url":"https://api.github.com/users/muasir/orgs","repos_url":"https://api.github.com/users/muasir/repos","events_url":"https://api.github.com/users/muasir/events{/privacy}","received_events_url":"https://api.github.com/users/muasir/received_events","type":"User","site_admin":false},"created_at":"2015-01-23T21:40:29Z","updated_at":"2015-01-23T21:40:29Z","body":"Closing based on @anupdugar  comment."}}