Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
50
rated 0 times [  52] [ 2]  / answers: 1 / hits: 24686  / 15 Years ago, thu, december 10, 2009, 12:00:00

I was wondering how to do twitter OAuth via a popup, i.e. load up the Oauth page in a popup and make the callback close the child window and reload the parent window.



Edit: OK iframes are bad, but how would you accomplish the above, I notice posterous.com does this - I'm looking to achieve the same flow as FB connect.


More From » iframe

 Answers
20

Doing the same thing for Yahoo today...




  1. Open a popup

  2. Send user to twitter for authentication

  3. Twitter sends user back to mysite.com/authcompleted.php, with authentication parameters in the query string. Still in the popup here.

  4. The popup (mysite.com/authcompleted.html) reads the query string and sends the data to the opener window via javascript



    window.opener.setTwitterAuthData(yourData)


  5. Inside setTwitterAuthData, which is in your main window, set appropriate form fields and submit the data to your server.



[#98104] Monday, December 7, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
noe

Total Points: 149
Total Questions: 91
Total Answers: 91

Location: Namibia
Member since Mon, Feb 21, 2022
2 Years ago
;