Skip to content

SQL AUTHENTICATOR Problems ? #147

@rbinsztock

Description

@rbinsztock

Well, i try to use Two authenticator my LDAP Authenticator works great but now i want to add an SQL one for backup.

The thing is i got only error when i try to connect with it :

oMethodError - undefined method length' for nil:NilClass: /home/rbi/sites/rubycas-server/lib/casserver/authenticators/sql.rb:83:invalidate'
/home/rbi/sites/rubycas-server/lib/casserver/server.rb:443:in block (2 levels) in <class:Server>' /home/rbi/sites/rubycas-server/lib/casserver/server.rb:435:ineach'
/home/rbi/sites/rubycas-server/lib/casserver/server.rb:435:in block in <class:Server>' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:1265:incall'
/home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:1265:in block in compile!' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:835:in[]'
/home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:835:in block (3 levels) in route!' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:851:inroute_eval'
/home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:835:in block (2 levels) in route!' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:872:inblock in process_route'
/home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:870:in catch' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:870:inprocess_route'
/home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:834:in block in route!' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:833:ineach'
/home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:833:in route!' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:936:indispatch!'
/home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:769:in block in call!' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:921:inblock in invoke'
/home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:921:in catch' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:921:ininvoke'
/home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:769:in call!' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:755:incall'
/home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/rack-protection-1.2.0/lib/rack/protection/xss_header.rb:22:in call' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/rack-protection-1.2.0/lib/rack/protection/path_traversal.rb:16:incall'
/home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/rack-protection-1.2.0/lib/rack/protection/json_csrf.rb:17:in call' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/rack-protection-1.2.0/lib/rack/protection/base.rb:47:incall'
/home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/rack-protection-1.2.0/lib/rack/protection/xss_header.rb:22:in call' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/rack-1.4.1/lib/rack/nulllogger.rb:9:incall'
/home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/rack-1.4.1/lib/rack/head.rb:9:in call' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/showexceptions.rb:21:incall'
/home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:99:in call' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:1389:inblock in call'
/home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:1471:in synchronize' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:1389:incall'
/home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/rack-1.4.1/lib/rack/handler/webrick.rb:59:in service' /home/rbi/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/webrick/httpserver.rb:138:inservice'
/home/rbi/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/webrick/httpserver.rb:94:in run' /home/rbi/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/webrick/server.rb:191:inblock in start_thread'

I have try with password in plain text with :

class: CASServer::Authenticators::SQL
database:
adapter: mysql2
database: rubycas_user
username: root
password: coucou
host: localhost
user_table: users
username_column: username
password_column: password

and another one with encrypted password :

class: CASServer::Authenticators::SQLEncrypted
database:
adapter: mysql2
database: rubycas_interface
username: root
password: coucou
host: localhost
user_table: users
username_column: login
encrypt_function: 'user.crypted_password == Digest::SHA1.hexdigest("--#{user.salt}--#{@password}--")'

i got the same error for both undefined method "lenght"

one with the SQL adapter and the encrypted one with the SQLencrypted adapater.

Thanks a lot.

My password are stored in SHA1 into my rubycas_interface.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions