Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Opening facebook connect window via javascript?

When someone tries to login to my site via facebook, he's redirected to a page where he sees all the requested permissions and click to allow / disallow them.

Is there any way to have this page open up as a layered window through javascript without having the user leave my website? E.g so my website would be in the background while the facebook connect window hovers above it.

Any ideas at all?

like image 558
Ali Avatar asked Jun 07 '11 06:06

Ali


Video Answer


1 Answers

The answer is no. Also, you can't load the login page within an IFrame since Facebook has a frame breaker for that page.

The page you're talking about is called the OAuth dialog. By default, requesting users to login to your app will cause a page redirect since the "display" parameter is set to "page" (other values include: popup, iframe, touch, and wap). What you want is to invoke this dialog with display set to "iframe". However, the documentation states: "If you specify iframe, you must have a valid access_token." And, to get an access_token, the user needs to first login to your app. For that reason, you won't be able show the login page within an embedded IFrame.

However, once a user authorizes your app with a basic permission set, you may prompt that user for additional permissions with the dialog's display mode to "iframe" (since you have the access_token).

like image 183
David H Avatar answered Oct 03 '22 16:10

David H