rbCAS / CASino

CASino is a Ruby-based Single Sign-On solution supporting the CAS standard
MIT License
331 stars 189 forks source link

Tests pass but still receiving "incorrect username or password" #60

Closed rollinsb1010 closed 10 years ago

rollinsb1010 commented 10 years ago

cas.yml

development:
    frontend:
    sso_name: "SEDL Login"
    footer_text: "Powered by <a href=\"http://rbcas.com/\">CASino</a>"

authenticators:
  sedl_worker_database:
    authenticator: "ActiveRecord"
    options:
      connection:
        adapter: "postgresql"
        host: "localhost"
        username: "postgres"
        database: "sedlrevamp_development"
      table: "workers"
      username_column: "name"
      password_column: "password"
      extra_attributes:
        email: "email"

workers_table schema

create_table "workers", force: true do |t|
  t.string "name"
  t.string "email"
  t.string "password"
end

example record:

id: 1
name: test4 
email: something@gmail.com
password: $2a$10$NGLYWXVBALzKtKNpvA5y7eHT.NryvSYYUt2rV.233WvwRTD03hh3K, #"secret"

stack trace

Started POST "/login" for 198.214.140.183 at 2014-08-11 15:16:18 -0500
Processing by CASino::SessionsController#create as HTML
Parameters: {"utf8"=>"✓",    "authenticity_token"=>"eH2fEegF7otQCkc+7d1RFcS8epNZlPBMg55zn3Sa5H4=", "lt"=>"LT-14077881571249-GxHERvxEfecei4FEB3lzx1yOJ0lEKquI5RmNOvJ3", "username"=>"brollins", "password"=>"secret", "button"=>""}

CASino::LoginTicket Load (0.7ms) SELECT "casino_login_tickets".* FROM "casino_login_tickets" WHERE "casino_login_tickets"."ticket" = 'LT-14077881571249-GxHERvxEfecei4FEB3lzx1yOJ0lEKquI5RmNOvJ3' LIMIT 1 Login ticket 'LT-14077881571249-GxHERvxEfecei4FEB3lzx1yOJ0lEKquI5RmNOvJ3' successfully validated SQL (1.0ms) DELETE FROM "casino_login_tickets" WHERE "casino_login_tickets"."id" = 141 (0.2ms) BEGIN CASino::LoginTicket Exists (0.4ms) SELECT 1 AS one FROM "casino_login_tickets" WHERE "casino_login_tickets"."ticket" = 'LT-14077881783785-0Zltlhz6qlfq0DeTXVeqIx4pDdjD4uDZ5q6G9FnD' LIMIT 1 SQL (0.5ms) INSERT INTO "casino_login_tickets" ("created_at", "ticket", "updated_at") VALUES ($1, $2, $3) RETURNING "id" ["created_at", "2014-08-11 20:16:18.381984"], ["ticket", "LT-14077881783785-0Zltlhz6qlfq0DeTXVeqIx4pDdjD4uDZ5q6G9FnD"], ["updated_at", "2014-08-11 20:16:18.381984"] COMMIT Created login ticket 'LT-14077881783785-0Zltlhz6qlfq0DeTXVeqIx4pDdjD4uDZ5q6G9FnD' Rendered /home/brian/.rvm/gems/ruby-1.9.3-p327/gems/casino-3.0.1/app/views/casino/application/_messages.html.erb (0.3ms) Rendered /home/brian/.rvm/gems/ruby-1.9.3-p327/gems/casino-3.0.1/app/views/casino/application/_footer.html.erb (0.2ms) Rendered /home/brian/.rvm/gems/ruby-1.9.3-p327/gems/casino-3.0.1/app/views/casino/sessions/new.html.erb within layouts/application (7.2ms) Completed 403 Forbidden in 30ms (Views: 14.5ms | ActiveRecord: 3.5ms)

pencil commented 10 years ago

Not sure if this is just a formatting issue on GitHub, but the authenticators: part in the YAML-file has to be a child of the development: node (or the respective environment).

development:
  authenticators:
    sedl_worker_database:
      # ...
rollinsb1010 commented 10 years ago

That was it. Thank you very much!