{"id":3623854,"date":"2013-04-03T22:28:43","date_gmt":"2013-04-03T22:28:43","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/problem-getting-access-token\/"},"modified":"2016-08-20T23:24:57","modified_gmt":"2016-08-20T23:24:57","slug":"problem-getting-access-token","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/problem-getting-access-token\/","title":{"rendered":"Problem Getting Access Token"},"content":{"rendered":"<p>I spent half my day debugging this. Turns out, the plugin is signing the request for an access token with both a token and a token secret &#8211; but at this stage of the OAuth flow, there is no token secret.<\/p>\n<p>I was able to work around the issue by updating the fetch_access_token function in the class-oauth.php file to the following:<\/p>\n<pre><code>public function fetch_access_token(&amp;$request) {\n    $this-&gt;get_version($request);\n\n    $consumer = $this-&gt;get_consumer($request);\n\n    \/\/ requires authorized request token\n    $token = $this-&gt;get_token($request, $consumer, &quot;request&quot;);\n    $token-&gt;secret = &quot;&quot;; \/\/Clear out the secret - there is none at this point\n\n    $this-&gt;check_signature($request, $consumer, $token);\n\n    \/\/ Rev A change\n    $verifier = $request-&gt;get_parameter(&#039;oauth_verifier&#039;);\n    $new_token = $this-&gt;data_store-&gt;new_access_token($token, $consumer, $verifier);\n\n    return $new_token;\n  }<\/code><\/pre>\n<p>https:\/\/wordpress.org\/extend\/plugins\/oauth-provider\/<\/p>\n","protected":false},"template":"","class_list":["post-3623854","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/3623854","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/3623854\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=3623854"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}