Giovanni Bitliner
Giovanni Bitliner

Reputation: 2072

Facebook server-side authentication: I cannot display an OAuth dialog as a popup instead as a page

I'm using server side Facebook authentication. So first, the application redirects the client to https://www.facebook.com/dialog/oauth?... URL, and in this URL there is, as a parameter, the string "display=popup", but when the application redirects the client the dialog is displayed as page, so no window is opened.

Upvotes: 1

Views: 1095

Answers (2)

Gianfranco P
Gianfranco P

Reputation: 10834

The previous answer is correct. Though remember to use '_blank' to have an actual popup:

window.open('/fblogin', '_blank','location=yes, scrollbars=yes, width=640, height=359', true);

These are also the sizes for the current OAuth login window.

Upvotes: 0

ori
ori

Reputation: 7847

Server side can only redirect to a URL; it cannot tell the client in which window to open/display the URL.

Facebook's client-side authentication takes care of showing the OAuth dialog in a popup window. If you have to use server-side authentication, you'll need to open the URL in a popup yourself:

window.open('URL_THAT_REDIRECTS_TO_OAUTH_DIALOG', ...)

but then you'll also need to set up the window dimensions (width/height) yourself (by specifying them in window.open()).

Upvotes: 2

Related Questions