I'm new to rails and just got a simple devise setup working. I'm looking to implement something that still uses the core devise feature set but would allow login via openid provider rather than "register w/ email or username"
How might I get started with this using the latest devise gem and rails 3?
Have a look at the devise_openid_authenticatable gem.
Related
I'm working on eCommerce for my internship project. But I don't know how to create the user authentication using rails and ember
First I assume the following things:
You are using ember to develop your frontend and will consume APIs from the backend.
You are using rails to create the necessary API.
If you want to authenticate users before using your API, check out the doorkeeper and devise gem. Devise takes care of things like storing your user details in the database, resetting the password, etc. The Doorkeeper gem is used to provide authentication and authorization to APIs.
Doorkeeper Link: https://github.com/doorkeeper-gem/doorkeeper
Devise Link: https://github.com/heartcombo/devise
I can't figure out how to access Wordpress via REST API with OAuth.
My App is made by Ruby on Rails. So I'd like to use RoR 5.1.
My objective is to get all post from the api.
As far as I check, no appropriate gem is there.
Anyone help please.
In Rails the common gem to deal with OAuth is OmniAuth.
1) If you did your authentication system based on Devise then you have an easy way to add OAuth to your app.
Here a good example to connect to Facebook API with Devise:
https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview
Here the gem to connect with WordPress:
https://github.com/jwickard/omniauth-wordpress-oauth2-plugin
2) If you didn't your authentication system with Devise then check the OmniAuth documentation to add it to your app:
https://github.com/omniauth/omniauth
And of course you will use the WordPress gem to add the strategy as well.
I want to add authentication to my Ruby on Rails 3 app, but I only need users to be able to authenticate using their Google accounts, because I'm making it a hosted app for the Chrome Webstore, so I think OpenID would work well for this. I want to have some custom fields in the user database to store user-specific data. What should I use for this? I want users to be able to sign up only with OpenID.
Thanks.
You should try omniauth gem, it uses not only Google OpenID. Omniauth takes user's data from provider and pass to your application which is you can amplify
I've been using authlogic and authlogic-oid add-on to handle this.
You could try the devise_openid_authenticatable gem. I haven't used it myself but it looks like it would do what you want using the Devise authentication gem, which is what I use on all of my Rails projects.
I have integrated Devise and OmniAuth with my Mongoid ORM setup using the following examples:
https://github.com/plataformatec/devise/wiki/Example-Applications
My client code is mostly JavaScript (ExtJS) and relies on JSON for all of the communication. I use no Rails templates. I am looking to build a multi-provider authentication model, primarily using user/pass, Facebook, and Twitter. I am having difficulty putting together the full User authentication flow with respect to my application stack.
I am looking for an example that uses JSON responses to the standard authentication actions, instead of redirects, and provides an integration with OmniAuth that uses Mongoid. In addition to the above examples, I have gone through Ryan Bates' Railscasts on Devise and OmniAuth. Every example I have worked through so far have either been ActiveRecord, or Rails template oriented. Any pointers are appreciated!
This (https://github.com/fertapric/rails3-mongoid-devise-omniauth) is a good example app for getting set up with rails 3, devise, omniauth and mongoid, and a tutorial to go along with it here: https://github.com/fortuity/rails3-mongoid-devise/wiki/Tutorial-(Walkthrough)
Then you'll need to override the user sessions controller to provide the correct json responses for your app, there is a good example here: https://gist.github.com/733647 and here: http://groups.google.com/group/plataformatec-devise/browse_thread/thread/daa3332b3c4a1b4b
Hope this helps
I would suggest that you roll your own authentication mechanism using Rails 3.1 ActiveModel::SecurePassword instead of using Devise. You will get a cleaner solution that way than trying to tweak Devise to provide JSON responses.
If you can't use Rails 3.1, I would still suggest that you roll your own instead of overriding an internal Devise method (which the gist that Nesbitt links to does).
i'm currently buidling my own blog using rails 3. and use devise gem for authentication. the problem is , i want only one user out here --- the admin user, and prehibits others from signing up, how can I achive that?
Is there any reason why you can not use Basic Http Authentication? IMHO devise seems to be an overkill for this usecase.