I haven't been able to find a way to mix the OmniAuth authentication system (which rocks by the way) and a normal authentication system (like restful authentication).
Any info on this? Thanks in advance!
Railscasts.com has some great screencasts showing how to integrate with Devise http://railscasts.com/episodes?utf8=%E2%9C%93&search=omniauth
Also, Devise itself has a branch integrated with omniauth if you only need one authentication strategy: https://github.com/plataformatec/devise/tree/v1.2.oauth
Related
I currently have a simple, hand-coded login system in my rails app. Now, I'm looking to integrate Facebook login via OmniAuth (seems to be the best way to do so)
However, I keep seeing Devise come up as a popular way to handle logins, with OmniAuth implemented in conjunction with it.
If I'm pretty happy with my login system now, is there any reason to use Devise? Does it give OmniAuth any extra functionality/extensibility or make it easier to use?
If you are a railscasts subscriber check out http://railscasts.com/episodes/235-devise-and-omniauth-revised
Devise does have some convenient hooks for omniauth, so that is a plus to using devise. That being said if you are happy with your authentication then you can simply build omniauth as a separate authentication method, and handle any overlap yourself. Also check out http://railscasts.com/episodes/241-simple-omniauth.
Good luck!
I'm trying to create a webapp using Backbone.js 0.9.2 + Rails 3.2.0. I'm having trouble figuring how to link authentication & authorization (role management) with the app. I'd like to use as much off-the-shelf product as possible.
After some research, I think Devise is pretty nice for user management, but I don't see any tutorials on Devise + Backbone.js. Does anyone have suggestions?
Also, I keep hearing about CanCan. Do I need it if I'm going to use Devise? Are there other options?
Cheers,
Dean
Devise handles authentication and CanCan handles authorization. I'm not sure how backbone.js plays into things since I've never used it before.
Just in case you're wondering, authentication has to do with logging in and logging out. And authorization is seeing if a logged in user or guest has access to utilize particular resources of your application. That's the nutshell from what I've read about it. Of course, I could be mistaken as I'm no expert with these things.
There are other options, but Devise and CanCan has been well established in the Rails community:
https://www.ruby-toolbox.com/categories/rails_authorization
https://www.ruby-toolbox.com/categories/rails_authentication
Good luck!
We need to have basic authentication in our Rails 3 app but the requirements are to also integrate with providers such as facebook, linked in, google apps, twitter, etc.
We are looking at:
Clearance
Divise
AuthLogic
... and others.
Any advice on which one to use that provides most of what we need?
OmniAuth is great for plugging in to third party authentication:
Code: https://github.com/intridea/omniauth
http://railscasts.com/episodes/235-omniauth-part-1
and
http://railscasts.com/episodes/236-omniauth-part-2
The above railscasts are great resources for a simple overview of using OmniAuth.
Devise is the current top dog, as it sets up sensible defaults, and makes it remarkably easy to override parts of the authentication system without affecting the rest.
It also has a branch and instructions to easily support OmniAuth for OAuth/OpenID authentication: https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview
I'm not experienced with either of these gems but I came across this blog post that had some high level points comparing Devise and Authlogic. http://www.quora.com/Ruby-on-Rails/How-should-I-choose-an-authentication-gem
This one persuaded me to start with Authlogic:
When a user logs in I like to set a cookie that has the username so I can access it from JavaScript. I know how to do this with Authlogic: add a line of code to UserSessionsController#create. How do I do it with Devise? I can't see how. (I don't want to do it on every page request. Just when they authenticate.)
You can give a shot to Sorcery gem which nicely handle third party authentification.
I found it easy to learn and to implement, and it's well documented too.
I don't try the other gems but this one is growing very fast right now, despite the fact that it's not an very old project
Good luck!!!
does restful authentication work in rails 3?
Is devise the new standard?
I would love for an authentition system to support website registration + twitter and openid, does devise do this?
Devise seems to be the new standard, I think it's a great auth solution and has support for pluggable auth strategies.
Checkout Janrain engage. They offer a free solution that lets you connect through numerous auth portals. It also works seamlessly into devise. There's a great railscast that outlines how to achieve this.
I am wondering how I can build the registration process like we have in Stack Overflow, where a user can login using one of several already existing accounts? I would prefer using Rails as a technology platform.
Are you looking for this?
http://testingauth.heroku.com/
I'm not sure this is exactly what you need, but the devise module, available on github, makes it very easy to build a authentication system in a rails application.
For authorization, another great module is called "cancan". You might need that too.
Check out OmniAuth. There are a few railscasts describing it.
You can use omniauth gem to implement openId auth. Also, it possible to extend your existing user auth systems. See great screencast about this at railscast: OmniAuth Part 1