Note that there are some explanatory texts on larger screens.

plurals
  1. POTwitter O-Auth Callback url
    primarykey
    data
    text
    <p>I am having a problem with Twitter's oauth authentication and using a callback url. </p> <p>I am coding in php and using the sample code referenced by the twitter wiki, <a href="http://github.com/abraham/twitteroauth" rel="noreferrer">http://github.com/abraham/twitteroauth</a></p> <p>I got that code, and tried a simple test and it worked nicely. However I want to programatically specify the callback url, and the example did not support that.</p> <p>So I quickly modified the getRequestToken() method to take in a parameter and now it looks like this:</p> <pre><code>function getRequestToken($params = array()) { $r = $this-&gt;oAuthRequest($this-&gt;requestTokenURL(), $params); $token = $this-&gt;oAuthParseResponse($r); $this-&gt;token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']); return $token; } </code></pre> <p>and my call looks like this</p> <pre><code>$tok = $to-&gt;getRequestToken(array('oauth_callback' =&gt; 'http://127.0.0.1/twitter_prompt/index.php')); </code></pre> <p>This is the only change I made, and the redirect works like a charm, however I am getting an error when I then try and use my newly granted access to try and make a call. I get a "Could not authenticate you" error. Also the application never actually gets added to the users authorized connections.</p> <p>Now I read the specs and I thought all I had to do was specify the parameter when getting the request token. Could someone a little more seasoned in oauth and twitter possibly give me a hand? Thank You</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload