Clearance with Facebook authentication

We’re currently using Clearance since we only needed simple user/pass authentication. Now we’ve been asked to allow users to sign in with Facebook as well.

Do you guys recommend trying to integrate this behavior with Clearance or would it be more beneficial to migrate to some other authentication library?

I found this gist of someone’s attempt from 2012 but it might be a little dated. Has anyone else attempted to integrate Facebook with Clearance recently?

Thanks!

Hi @shuber

If you take a look at the AuthHashService provided within the Upcase repo you’ll notice it has been setup to support multiple providers.

I’ve personally and professionally used this service file (with a bunch of additions/changes) to support multiple OAuth providers.

All you need to do is install the omniauth-facebook gem, bundle install and add your keys to the omniauth.rb initializer. Although the post you linked to is a bit old, the theory and concept remains.

Give it a try and if you get stuck, let us know on here your problem.

Good luck!

Hi, it seems that link you provided is no longer up, is there another one?