Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open Facebook Login popup instead of redirecting to login page in the same window #140

Closed
ghost opened this issue Sep 6, 2011 · 7 comments

Comments

@ghost
Copy link

ghost commented Sep 6, 2011

Thanks a lot for this wonderful libraray. I have a doubt with the current behaviour of my application wrt to facebook connect and I was wondering if you could help me,

Is there a way by which I could open the facebook login page in a new modal window , instead of redirecting user to log in page on the same window and than redirecting him back to the application once he is authorized. I know there is a way of doing that using the javascript sdk but i am looking for server side authorization.

Any help would be greatly appreciated.

@omab
Copy link
Owner

omab commented Sep 6, 2011

You could try opening the login page on a popup, that will show Facebook login/authorization form in the popup (maybe the mobile version suites better, I'm not sure if facebook has a popup version for server side auth). Finally when completing the loging you just close the popup with JS.

Makes sense?
Matías

PD: I'm closing the bug because this is not really a bug, but we can keep the discussion on.

@omab omab closed this as completed Sep 6, 2011
@ghost
Copy link
Author

ghost commented Sep 7, 2011

Thanks a lot for your reply. But i am still not sure how to go about doing
this. The problem is facebook login page belongs to a completely different
domain and hence i cant attach events to the popup window. So i dnt know how
would i find out when user has logged in and i can close the popup window.

Regards
Ritesh Kadmawala

On Tue, Sep 6, 2011 at 10:35 PM, omab <
reply@reply.github.com>wrote:

You could try opening the login page on a popup, that will show Facebook
login/authorization form in the popup (maybe the mobile version suites
better, I'm not sure if facebook has a popup version for server side auth).
Finally when completing the loging you just close the popup with JS.

Makes sense?
Matas

PD: I'm closing the bug because this is not really a bug, but we can keep
the discussion on.

Reply to this email directly or view it on GitHub:
#140 (comment)

Regards

Ritesh Kadmawala

@omab
Copy link
Owner

omab commented Sep 7, 2011

Yes, but Facebook will redirect back to your app when user logged in and you can make that return-back view a simple page that just does a popup-close JS line. Basically it will like this:

  1. Open popup to social auth /login/facebook/ view
  2. Popup will load Facebook login page
  3. User logins/accepts the app
  4. Facebook redirect backs social auth /complete/facebook/ view
  5. Social auth app makes the user login and redirects to view defined by SOCIAL_AUTH_LOGIN_REDIRECT_URL setting.
  6. You defined a view under that final URLs that just closes the template.

I'm not really sure, but I think you can produce the same with iframes instead of a window popup, and you can embed that iframe in a modal dialog generated by any JS library around.

@ghost
Copy link
Author

ghost commented Sep 7, 2011

thanks a lot. I was able to figure out how to do it as soon as i sent you an
email. Anyways it was nice of you to still help me with the solution.

On Wed, Sep 7, 2011 at 12:47 PM, Matas Aguirre <
reply@reply.github.com>wrote:

Yes, but Facebook will redirect back to your app when user logged in and
you can make that return-back view a simple page that just does a
popup-close JS line. Basically it will like this:

  1. Open popup to social auth /login/facebook/ view
  2. Popup will load Facebook login page
  3. User logins/accepts the app
  4. Facebook redirect backs social auth /complete/facebook/ view
  5. Social auth app makes the user login and redirects to view defined by
    SOCIAL_AUTH_LOGIN_REDIRECT_URL setting.
  6. You defined a view under that final URLs that just closes the template.

I'm not really sure, but I think you can produce the same with iframes
instead of a window popup, and you can embed that iframe in a modal dialog
generated by any JS library around.
6.

Reply to this email directly or view it on GitHub:
#140 (comment)

Regards

Ritesh Kadmawala

@camilonova
Copy link

Can you please what you sent in the email? i would like to see the example

@bimboy
Copy link

bimboy commented Dec 19, 2011

hi can someone please email me a sample code with the solution for this problem. thank you

bimboy143@gmail.com

@cliffrwong
Copy link

Hi. I have the popup login window automatically close after login. But I want to update the original window that the user has logged in. Any idea how to send the signal back to the original window? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants