views:

681

answers:

6

I've been following ryan baytes screencast #170 and adding ruby-openid, authlogic and authlogic-oid to an existing authlogic authentication system.

However, i keep getting the following stack of errors:

NameError (uninitialized constant OpenIdAuthentication::InvalidOpenId): /Library/Ruby/Gems/1.8/gems/authlogic-oid-1.0.4/lib/authlogic_openid/session.rb:53:in openid_identifier=' /Library/Ruby/Gems/1.8/gems/authlogic-oid-1.0.4/lib/authlogic_openid/session.rb:47:incredentials=' authlogic (2.1.2) lib/authlogic/session/foundation.rb:28:in initialize' authlogic (2.1.2) lib/authlogic/session/password.rb:140:ininitialize' authlogic (2.1.2) lib/authlogic/session/activation.rb:48:in initialize' authlogic (2.1.2) lib/authlogic/session/klass.rb:61:ininitialize' authlogic (2.1.2) lib/authlogic/session/scopes.rb:79:in initialize' app/controllers/user_sessions_controller.rb:10:innew' app/controllers/user_sessions_controller.rb:10:in `create'

Is there anyone who's facing the same kind of problem? i'm using rails 2.3.4

I've tried binary's example app which is working perfectly well (rails 2.1.2), i've tried the code provided by ryan bates and it is working well too (rails 2.3.2). So, the libraries are working with previous versions of rails.

Any clues?

A: 

I'm experiencing similar (not exactly the same) kind of error. (And I've been following railscast #170 too). I'm using rails 2.3.5

uninitialized constant AuthlogicOpenid::Session::Methods::OpenIdAuthentication

Ruby19/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:440:in `rescue in load_missing_constant'

Ruby19/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:436:in `load_missing_constant'

Ruby19/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in `const_missing_with_dependencies'

Ruby19/lib/ruby/gems/1.9.1/gems/authlogic-oid-1.0.4/lib/authlogic_openid/session.rb:53:in `rescue in openid_identifier='

Ruby19/lib/ruby/gems/1.9.1/gems/authlogic-oid-1.0.4/lib/authlogic_openid/session.rb:51:in `openid_identifier='

Ruby19/lib/ruby/gems/1.9.1/gems/authlogic-oid-1.0.4/lib/authlogic_openid/session.rb:47:in `credentials='

Ruby19/lib/ruby/gems/1.9.1/gems/authlogic-2.1.3/lib/authlogic/session/foundation.rb:28:in `initialize'

Ruby19/lib/ruby/gems/1.9.1/gems/authlogic-2.1.3/lib/authlogic/session/password.rb:140:in `initialize'

Ruby19/lib/ruby/gems/1.9.1/gems/authlogic-2.1.3/lib/authlogic/session/activation.rb:48:in `initialize'

Ruby19/lib/ruby/gems/1.9.1/gems/authlogic-2.1.3/lib/authlogic/session/klass.rb:64:in `initialize'

Ruby19/lib/ruby/gems/1.9.1/gems/authlogic-2.1.3/lib/authlogic/session/scopes.rb:79:in `initialize'

/app/controllers/user_sessions_controller.rb:11:in `new'

/app/controllers/user_sessions_controller.rb:11:in `create'

Corresponding action in user_sessions_controller looks like this

def create @user_session = UserSession.new(params[:user_session]) @user_session.save do |result| if result flash[:notice] = "Login successful!" redirect_back_or_default account_url else render "login" end end end

The Parameters: {... "user_session"=>{"email"=>"", "password"=>"[FILTERED]", "remember_me"=>"0", "openid_identifier"=>"someid.myopenid.com"}

So it just fails creating the user_session (not even saving it). Unfortunately I have not figured out how to fix this yet. So i just join this this thread to know if someone has found the solution to the problem.

Sergii Vozniuk
+2  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
A: 

Sergii, did you solve this problem?

Christof
A: 

Briefly... no

i guess there are too many dependent libraries and debugging the problem took a bit of time, so we shifted to using masquerade, making the app itself an openid provider.

cnicolaou
A: 

I have found this:

http://futureadapter.com/2009/11/13/authlogic-plugin-errorfix/

But I don't know how to apply this code ( were to I put it ? ) so that it fixes the authlogic_oid problem.

Can anyone check it out and see how to apply it?

Thanks.

Victor Martins
A: 

Check this out:

http://testingauth.heroku.com/

Authlogic setup with openid and jquery selector.

Source: http://github.com/shripadk/authlogic_openid_selector_example

Shripad K