-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug fix for the api end point #2
base: master
Are you sure you want to change the base?
Conversation
I though the endpoint was already correct? "The endpoint for the authorization url is https://api.twitter.com/oauth/authorize. It must have a single query parameter attached called oauth_token with the value set to the oauth_token you received in the request token step" |
Actually, is this works without the https ? Maybe you are right, but this fixed the issue for sure, at least in my case :) |
"The bug was that it keeps asking for authorization each time we loose the session, even if the connexion was successful the first time." I'm not exactly what you mean. Could you describe the bug a bit more? |
Sorry about my english, Maybe it's due to the use of this library I have, but I need the user to sign-in, maybe this method is made for something else ? I refer to this page that gave me the solution : http://dev.twitter.com/pages/sign_in_with_twitter Then http://dev.twitter.com/doc/get/oauth/authenticate That says : _for applications using the Sign in with Twitter authentication flow. The method will use the currently logged in user as the account for access authorization_ So the bug was that each time users tried to log in to my application, twitter was making a new authorization request, and were unable to recognize the user, even if he already give its authorization once. Hope this is more clear. |
What were the bugs and how did u fix it. I am getting a similar problem. It keeps asking for permission again and again. Can you help me, with what should be the changes made and where |
Hi, It seems that Eliott did not accept the pull yet, you can get the fix there : RayFranco/codeigniter-twitter@eef8b68e992635e72b1e464c0fb0e212b8219318 Good luck |
Hi, i am facing the same issues even after applying the fix. checkout http://www.jobiance.com/tweet_test/ Is anything missing ? Please help. It's urgent! Abhay |
I don't know if this Pull Request will fix my issue, but I am being redirected back to Twitter every single time. I've already merged in @rayfranco's eef8b68 commit. |
Hi cdevroe, Seems you are struggling big time. Check your curl libraries . Check if your php framework supports Query Strings (e.g. http://www.hireplug.com?authorize_url=www.fbapp.hireplug.com I was using codeigniter and codeiginter by default supports segment urls not query strings. Here's my tweet working library for your reference.
|
I thought CodeIgniter, by default, disabled querystring? So, now I have to hack that or simply change my setting? Is there anyway to change the setting just for this one URL? |
Also, if the above is true, maybe the documentation for the library should say that? |
Hi, I'm not sure at all about the querystring enabling, It's twitter side problem, isn't it? There is nothing from your application side that will tells Twitter if he had registered the loggedin user to your App or not, Actually its only guessing. Are you working from your localhost ? Have you well registered you app with the right callback URL (or setting it manually) ? Have you applied the patch ? abhaykumar, have you tried the path before enabling the querystring ? It wasn't working ? Cheers Envoyé de mon iPhone Le 19 avr. 2011 à 22:43, [email protected] a écrit :
|
Hi, RayFranco yes i tried the path before enabling the querystring. It wasn't working for me. In the constructor of tweet_test controller i had to do this: $qs = $_SERVER['QUERY_STRING']; checkout: |
Hi, I've checked my project where I've build this patch to make it working, I didn't do this little hack you did (I had to use it one day but on a different case). Here are what I've changed from the config.php about url's :
Here I'm still on Query String disabled :
This makes it working enough for me. I still didn't catch where it makes a difference.... Strange thing. |
@rayfranco or anyone else. Can someone provide me with their Tweet_test controller? I think I've narrowed down my problem to the fact that no matter what, this line is always TRUE if ( !$this->tweet->logged_in() ) |
Hi cdevroe, I'm not testing on that Tweet_test controller that provides the lib, it seems to be a little intrusive so I just use it as a "snippet" to quicky see what are the methods that suit my needs. In practice, I do not check if the user is connected to the app on every controller call. When the user is loggin-in, I check if he is in my database, if not, insert the infos I need, if so, just update the infos then I use these until the end of the session. It's a bit more conventional I think... Here is my login method I use in my last twitter app :
The third segment is used to redirect the user to the page he checked the logged in user. It's not very sexy tho ;) Hope this helps. |
@rayfranco First, thanks to you and everyone else for helping me out with this issue. Beer is on me shall we ever meet. Second, I see what you're doing here only $this->tweet->get_tokens() (for me) doesn't seem to get the tokens returned from Twitter. And I'm not sure why. Also, if I look at your tweet.php library and @abhaykumar 's tweet.php library you two are using two different URLs. Authenticate vs. Authorize. I'm using Authenticate (as it appears that you are). |
@rayfranco & @abhaykumar I've shared my tweet_test controller here: https://gist.github.com/f5bc3f0b18b66bdf61ee |
@cdevroe Can you tell me what
throws when you got back from login ? Does it says something ? And are you working on your localhost ? Have you checked the configuration on twitter ? (domain, callback url) The tokens are useless unless you need to fake a user connection (to send tweets when he's logged out for example). I'm not using them, I just store them, just in case. Cheers. |
@rayfranco The callback works as it runs Auth() on its way back. But nothing from verify_credentials ever makes it because it runs login() again and redirects back to Twitter. Endless loop. Here is the log file (if you compare it with the Gist) 53 DEBUG - 2011-04-21 14:46:08 --> Language file loaded: language/english/unit_test_lang.php |
Yes, I'm still poking at this. One thing I did notice is that the Library looks for oauth_token and oauth_token_secret and not oauth_verifier (which is what Twitter sends back regardless of the URL /authorize/ or /authenticate/). I think this is my entire issue and now I'm wondering why no one else has run into this. |
Also, so far I still have yet to enable querystring URLs. When I do $_GET['oauth_token'](which the Library does) I can not retrieve that value. But setting that to TRUE would adversely affect my entire application. |
@abhaykumar Even your hack for getting the querystring wouldn't work unless I enabled the querystring in CodeIgniter. By default CI disables $_SERVER['QUERY_STRING'] So now I'm left with two issues, as I see them. 1) I can not use $_GET at all and the Library uses that to retrieve the oauth_token. 2) Even if I could use $_GET the Library is looking for oauth_token and oauth_token_secret and Twitter replies with oauth_token and oauth_verifier Any help here would be great. I consider all of you my idols that any of you ever got this Library working. Who is up for starting a new project where we write our own and support it? |
After hacking the tweet_test some where to force $_GET I'm hitting a secondary wall. The Library now recognizes as being "logged in" properly. However, it can not gain an Access_Token and Access_Secret, presumably because it would also use $_GET to do this. The error I get in my logs now is: "Request token must be exchanged for an access token before use". And from what I can see the controller is trying to retrieve this information itself via getAccessKey and getAccessSecret. I've updated the Gist of my tweet_test controller to show the hack (which I poorly coded since I hope I don't have to actually use it). https://gist.github.com/f5bc3f0b18b66bdf61ee |
Hi! Regarding the Request token hoopla, here is an interesting thread to determine if you have tokens: http://codeigniter.com/forums/viewthread/181901/ If they're saving, $_GET shouldn't be the issue, right? Turns out mine are available - there's just some kind of weird thing about passing it to Twitter.
Baby steps.. |
Check it! |
Hi,
It seems that you misspell the new authorization URL, so I just did a fix for my needs, wanted to share what fixes it.
The bug was that it keeps asking for authorization each time we loose the session, even if the connexion was successful the first time.
Cheers, and good job !