views:

837

answers:

5

Using authlogic 2.1.3, and authlogic-oid 1.0.4 I receive the following error as soon as rails hits a controller making a request to an OpenID provider:

uninitialized constant OpenIdAuthentication::InvalidOpenId

I also have the following installed:

  • rack-openid (0.2.1)
  • ruby-openid (2.1.7)
  • rails/open_id_authentication plugin

Gems in environment.rb are configured as such:

config.gem "authlogic"
config.gem "authlogic-oid", :lib => "authlogic_openid"
config.gem "ruby-openid", :lib => "openid"

Any suggestions would be appreciated, thank you.

+6  A: 

rails/open_id_authentication plugin has been updated a few days ago and it breaks compatibility with the authlogic_openid gem (v=1.0.4).

Youl'll have to wait until someone fix the authlogic_openid gem (the issue)

Jessy
thanks Jessy - thought I was missing a gem.. it was doing my head in :)
Bayard Randel
+3  A: 

I was having the same trouble and I really wanted open-id with authlogic, so I copied an old version of plugin from one of Ryan Bates' railscasts apps.

Here's the link [email protected]:senthilnambi/open-id.git. Install it like normally and you should be fine.

Hope this helps. :)

Senthil
thanks Senthil :)
Bayard Randel
+1  A: 

Just like senthil provided, but with no @ at URL:

script/plugin install git://github.com/senthilnambi/open-id.git

Then I erase the old (plugin/gem) who does not work

Fabiano PS
+4  A: 

I resolved that issue in my authlogic_openid fork, feel free to grab this commit: http://github.com/mreinsch/authlogic_openid/commit/9b802c347f5addebcbce945af3b5f80b3ee7b214

Michael Reinsch
@Michael, what is the correct way to install this gem? I tried 'sudo gem install authlogic-oid --git://github.com/mreinsch/authlogic_openid.git'. Should I install this as a plugin instead? If so, do I still need the authlogic-oid gem (1.0.4)?
Craig
I was hoping to get my patches into the official authlogic-oid, so I didn't publish a gem. You can always use it as a plugin, or have a look at what http://github.com/binaryfeed/authlogic_openid did.In case you are installing authlogic_openid as a plugin, be sure to remove the authlogic-oid gem.
Michael Reinsch
Michael's fork worked for me too. Thanks a lot. Unfortunately this wasn't the end of my troubles. With google I get 'Error attempting to use stored discovery information: OpenID::TypeURIMismatch' - with yahoo it doesn't work either and gives: 401 Unauthorized [http://127.0.0.1/users]
ro
A: 

Going through the railscast 170. Troubleshooting lead me here. I tried authlogic_openid fork from last poster (mreinsch). This thankfully corrected openid_identifier error long enough for the regular login system to work, but not openid.

It's giving me an name error on the save method as identified in the block. This is apparently used to allow openid to get me to login.

Error Dump:

NameError in User sessionsController#create
uninitialized constant Rack::OpenID
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:443:in `load_missing_constant'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in `const_missing'
/Sites/authlogic_b/vendor/plugins/authlogic_openid/lib/authlogic_openid/session.rb:72:in `save'
/Sites/authlogic_b/app/controllers/user_sessions_controller.rb:8:in `create'