bukowski
bukowski

Reputation: 1943

How to display facebook authorization window in a popup using php SDK?

I want to display authorization window in popup, however this doesn't seem to be working

getLoginUrl(array('scope' => 'read_stream,publish_stream','display' => 'popup'));

Is it possibble with just php SDK?

Upvotes: 1

Views: 2049

Answers (1)

ori
ori

Reputation: 7847

Only the client side determines where a page gets loaded (for instance: own window, parent window, top window, popup), server side doesn't control or know about that.

To open a popup window you have to call window.open() (look it up). If you do want to do server-side oauth, you can getLoginUrl() in php and store it in the page (javascript var / data- attribute, etc.) and then call window.open at the right time to open the login url in a popup.

However, you can't just open a popup whenever you want --you'll get blocked. So you'll need to add a "login" link for the user to click on, and an event handler for that click that will open the popup.

Upvotes: 2

Related Questions