Error while implementing oauth provider using oauth-plugin(pelle) - ruby-on-rails

I want to secure my web application's API using oauth. I searched a lot & finally decided to try following link http://stakeventures.com/articles/2007/11/26/how-to-turn-your-rails-site-into-an-oauth-provider.
I followed the steps & I am able to register new application successfully.
I am using devise for authentication & the pelle's oauth-plugin is compatible with acts_as_authenticated, restful_authentication or restful_openid_authentication as mentioned in the above post.
So I am getting following error when I try to run http://localhost:3000/oauth/autherize
NameError (undefined local variable or method `login_required' for #<OauthController:0xc410490>):
I searched for the solution & I got following link http://groups.google.com/group/oauth-ruby/browse_thread/thread/3656e3904050fd9a.
Now is there any alternate solution other than mentioned in above link. If yes then please guide me about that & if not then please tell me how to actually implement the solution.
Where actually the oauth_controller_spec.rb file resides? Do I need to fork & edit the plugin for that?

You may want to have a look here: authlogic and oauth-plugin. Maybe this answer is helpful.

Related

Authenticating users Ionic App with Rails + Devise backend

Has anyone successfully implemented authentication on an Ionic application that uses a Rails application with Devise as a backend? If so, what implementation did you use to that end?
I have already tried solutions like cloudspace's angular-devise but it doesn't really play well with Devise on the server due to CORS (which I have already included the headers needed for it to work)
The current rails application allows facebook login, it would be nice if the Ionic app had that ability as well.
Try to give this cloudspace's angular-devise another shot
I have combined it with rack-cors
and it worked for me.
Another Implementation via Toke Auth is also working..
An example implementation of the rails part can be found here:
https://github.com/julianbei/authService
The Ionic Part can be found here:
https://github.com/julianbei/authService/tree/master/mobile
Its not beautiful but a working "quick and dirty" implementation
good luck!

Authlogic_oauth2 alternative for Rails 2.3

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
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!
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.
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

Using Windows Authentication in Ruby on Rails

I'm working on a Rails app for an internal project and can't work out how to set up the users model to use Windows Authentication for logging in. I had a look and can't find anything that was covering this topic. I've managed to configure Rails to use SQLServer fine but I'm just blanking here.
Thanks in advance.
Maybe this article helps: http://www.zorched.net/2007/06/04/active-directory-authentication-for-ruby-on-rails/

Authlogic_OpenID - "uninitialized constant Rack::OpenID"

So I followed the railscast tutorial (http://railscasts.com/episodes/170-openid-with-authlogic) and used the old version of the plugin from Ryan's git file. I can now successfuly create/register a user using OpenID (Google), but I cannot log in with this user. When I submit the OpenID that has been registered, I get "uninitialized constant Rack::OpenID". Any ideas?
Thanks!
I would suggest trying the latest version of the plugin, or the gem.
Things change quick in rails, and old code can break with new versions of rails.
I would suggest trying Devise, it is easier for integrate OpenId, Facebook, Tweeter ...
https://github.com/plataformatec/devise

Creating a basic facebook application with Rails

I am creating a simple facebook application using Ruby on rails and I am following the liveRail tutorial available here
http://www.liverail.net/articles/2007/6/29/tutorial-on-developing-a-facebook-platform-application-with-ruby-on-rails
The problem that Im facing is that when I launch my server it throws an error saying that it cant find the 'gem_original_require' : no such file to load facebook_rails_controller_extensions.
I have added the rfacebook gem but the error is thrown when i include the require
require "facebook_rails_controller_extensions" in the environment.rb file.
Im not completely sure whether this is the right way to go with Rails 2 but I've between making changes when i find relevant information for Rails 2
I would appreciate any suggestions on this or any links to other tutorials too.
Thank you
That tutorial is SEVERELY out-of-date and you're going to have lots of issues if you keep following it. rFacebook hasn't be actively maintained in a good 2 years. You should be using Facebooker.
There is a good facebooker tutorial here: http://apps.facebook.com/facebooker_tutorial/
Examine your $LOAD_PATH variable.
It's a common issue that your load path doesn't contain library.
Use $LOAD_PATH<<'/usr/lib/superrubylib' to add a path to load.
Uh, and it seems to be a best practice to use require File.dirname(__FILE__) + "/../relative/path" to set up relative paths.
P.S. Please, specify more data about paths and locations to let us answer your question specifically.

Resources