Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple SQLEncrypted authenticators #185

Open
dziamid opened this issue Aug 8, 2013 · 0 comments
Open

Multiple SQLEncrypted authenticators #185

dziamid opened this issue Aug 8, 2013 · 0 comments
Milestone

Comments

@dziamid
Copy link

dziamid commented Aug 8, 2013

I've set up a list of authenticators:

authenticator:
  -
    class: CASServer::Authenticators::SQLEncrypted
    database:
      adapter: mysql2
      database: beta_assistentby
      username: cas
      password: asdfasdf
      host: localhost
    user_table: user
    username_column: email
    password_column: password
    encrypt_function: 'user.password == Digest::MD5.hexdigest("#{@password}{easybooker_is_cool}")'

  -
    class: CASServer::Authenticators::SQLEncrypted
    database:
      adapter: mysql2
      database: assistentproru
      username: cas
      password: asdfasdf
      host: localhost
    user_table: user
    username_column: email
    password_column: password
    encrypt_function: 'user.password == Digest::MD5.hexdigest("#{@password}{easybooker_is_cool}")'

  -
    class: CASServer::Authenticators::SQLEncrypted
    database:
      adapter: mysql2
      database: assistentby
      username: cas
      password: asdfasdf
      host: localhost
    user_table: sf_guard_user
    username_column: email
    password_column: password
    encrypt_function: 'user.password == Digest::SHA1.hexdigest("#{user.salt}#{@password}")'

I expect the credentials to be authenticated agains every database in the list.
This is what is happening in the logs:

#casserver.log

Processing CASServer::Server::call {"username"=>"[email protected]", "password"=>"******", "lt"=>"LT-1375951647rjdlPcwt3ntfLG9bs4F", "service"=>"", "locale"=>"ru"}
Validating login ticket 'LT-1375951647rjdlPcwt3ntfLG9bs4F'
Login ticket 'LT-1375951647rjdlPcwt3ntfLG9bs4F' successfully validated
Generated login ticket 'LT-1375951659r8QkATG1w7tDmyhhQMt' for client at '82.209.222.52'
Logging in with username: [email protected], lt: LT-1375951659r8QkATG1w7tDmyhhQMt, service: , auth: [CASServer::Authenticators::SQLEncrypted, CASServer::Authenticators::SQLEncrypted, CASServer::Authenticato$
CASServer::Authenticators::SQLEncrypted: [CASServer::Authenticators::SQLEncrypted::CASUser_2] Connection pool size: 0/5
CASServer::Authenticators::SQLEncrypted: [CASServer::Authenticators::SQLEncrypted::CASUser_2] Connection pool size: 1/5
CASServer::Authenticators::SQLEncrypted: [CASServer::Authenticators::SQLEncrypted::CASUser_2] Connection pool size: 1/5
Invalid credentials given for user '[email protected]'

#cassserver_db.log

  ^[[1m^[[36mCASServer::Authenticators::SQLEncrypted::CASUser_2 Load (0.2ms)^[[0m  ^[[1mSELECT `sf_guard_user`.* FROM `sf_guard_user` WHERE (email = '[email protected]')^[[0m
  ^[[1m^[[35mCASServer::Authenticators::SQLEncrypted::CASUser_2 Load (0.2ms)^[[0m  SELECT `sf_guard_user`.* FROM `sf_guard_user` WHERE (email = '[email protected]')
  ^[[1m^[[36mCASServer::Authenticators::SQLEncrypted::CASUser_2 Load (0.1ms)^[[0m  ^[[1mSELECT `sf_guard_user`.* FROM `sf_guard_user` WHERE (email = '[email protected]')^[[0m

Seems like cas is querying the same databases (CASServer::Authenticators::SQLEncrypted::CASUser_2) 3 times.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant