6

My end goal is for users to have multiple 3rd party authentications at the same time.

Right now, I am using Devise to create users. Users can sign up via email or facebook or google and it works. But now, after they have already signed up, I need them to also verify with, say, youtube or soundcloud. So the user was created with devise, but I also need them to verify with other things.

Since Devise hogs omniauth for it's own purposes, I can't use omniauth on the side.

As I see it I have three options:

  • Try to monkeypatch devise and get it to allow multiple authentications at the same time on one user
  • Do oauth by hand on the side adjacent to current Devise implementation
  • Scrap Devise and do something different

I would greatly appreciate any advice or other options

2 Answers 2

1

I think this may be what you need: http://blog.joshsoftware.com/2010/12/16/multiple-applications-with-devise-omniauth-and-single-sign-on/

They open sourced their code too!

Provider: https://github.com/joshsoftware/sso-devise-omniauth-provider Client: https://github.com/joshsoftware/sso-devise-omniauth-client

Or even better, check out this: http://communityguides.heroku.com/articles/16

Sign up to request clarification or add additional context in comments.

Comments

1

Try to monkeypatch devise and get it to allow multiple authentications at the same time on one use

You don't need to monkeypatch devise --- you can have your own oauth controller the has

class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController

  def facebook
    # handle if already a twitter user
    # handle if a new user
    # use the `sign_in user` to sign_in the user
  end

  def twitter
    # handle if already a facebook user
    # handle if a new user
  end
end

and use it in routes

devise_for :user, 
         :controllers => {
           :omniauth_callbacks => "users/omniauth_callbacks"
         }

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.