Question

In order to let users signup and login using facebook I used the authlogic_oauth2 gem (v.1.1.2) along with oauth2 (v. 0.0.10) and authlogic (2.1.6) in a Rails 2.3 application.

Everything worked well for more than 2 years but from a month or so, users are not able to login or signup with Facebook anymore.

I don't know what happened but I didn't changed anything so it seems that Facebook changed something on their end and authlogic_oauth2 doesn't seem to be able to work anymore.

Which could be the easiest way to fix the issue and bring back user login/signup with facebook? Is there any better gem to help on the job?

Thanks in advance, Augusto

Was it helpful?

Solution 2

I found the solution: Omniauth works perfectly fine with Rails 2.3 and there is even a demo app on how to integrate it with Authlogic.

OTHER TIPS

I doubt that you may have done some changes in your present application unknowingly that caused the login and logout failures.

One possible cause of the problem might be the redirections from: http://yoursite.com to http://www.yoursite.com based on the changes that you made. Check the blog that mentions this problem.

The fix is to set: config.action_controller.session[:domain] = '.YOURDOMAIN.COM' inside of environment.rb (Make sure to prefix it with the .). That will make cookies work for both www.yourdomain.com and yourdomain.com (as well as any other subdomains).

I also recommend to check the login behavior in different environments: Development and Production and then check the output in the log files clearly.

This may help you to tweak the problem domain, as you mentioned that your code was working previously.

Update:

there is an update in facebook oauth and it is mentioned that all applications need to be updated to the latest version of oauth.

So that is the possible cause for your problem.

It outlines a plan requiring all sites and apps to migrate to OAuth 2.0, process the signed_request parameter, and obtain an SSL certificate by October 1.

check the link below:

http://developers.facebook.com/blog/post/497/

Thanks!

A popular one would be Devise which plays well with Omniauth. I am not sure of the compatibilities with rails 2 though, maybe time to upgrade...

Any reason you can not use Koala? https://github.com/arsduo/koala

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top