Twitter oauth authorization in popup and not in main browser window

I feel incredibly stupid for even asking about it, since the answer may already be under my nose, but here it goes:

TweetMeme has a twitter twitter widget that publishers can post on their blogs. When the user clicks on the widget, it opens a window that allows the user to authenticate using twitter, and then re-tweet.

This, apparently, uses a special Twitter oauth special form factor - unless something suits the surface to authenticate the user.

The popup looks like this:

http://twitpic.com/1kepcr

I'd rather handle authentication through a pop-up window rather than send the user to a new page (for the application I'm working on), and they seem to have the most elegant solution. Thoughts on how they did it?

+7
oauth twitter popup
source share
3 answers

I think the process looks something like this (I assume they used php on the server side):

First, it opens a popup similar to jQuery, but it has no strict relation to the functions of the Twitter function. The real registration process starts when you confirm this popup, so it opens a new popup with some php inside that # is conducting the session. These scripts ask you to twitter request tokens using site parameters and save them in the $ _SESSION array. If everything is correct, Twitter will send you to the twitter authentication page ( https://twitter.com/oauth/authenticate ), and after you have inserted your login parameters, you will send Twitter to the callback page on this site. Here is another php page that requests access tokens and stores them in the $ _SESSION array. If everything is in order, now the site has the parameters that it needs to request your profile, so the last scripts inside the popup window update window (the main site) are closed. Now in the main window there are all the interesting parameters inside the $ _SESSION array.

Check this useful library for all server-side work.

+3
source share
+2
source share

All they do is open the http://api.tweetmeme.com/share?url=someURL&source=tweetmeme page in a new window (using the target _blank), then start the process from there.

EDIT: I was looking for the wrong retweet button. In your specific example, clicking the retweet button first opens the Tweetmeme http://tweetmeme.com/ajax/partial ? ... page in a new window. Clicking โ€œyesโ€ then initiates the OAuth process, sending you (still in this window) to https://twitter.com/oauth/authenticate (with the appropriate parameters).

0
source share

All Articles