rubycas / rubycas-client

Ruby client for Yale's Central Authentication Service protocol -- an open source enterprise single sign on system for web applications.
http://code.google.com/p/rubycas-client/
Other
332 stars 217 forks source link

Fix for failure during CAS single sign out when ActiveRecord::SessionStore is not used #58

Closed su-docker closed 11 years ago

su-docker commented 11 years ago

When anyother session store (ActionDispatch::Session::CookieStore) is used by the Rails app, the single sign out POST request sent by the CAS server ends up in the following exception


ActiveRecord::StatementInvalid (PG::Error: ERROR: relation "sessions" does not exist LINE 4: WHERE a.attrelid = '"sessions"'::regclass ^ : SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"sessions"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum ): . . . activerecord (3.2.6) lib/active_record/session_store.rb:98:in find_by_session_id' rubycas-client (2.3.9) lib/casclient/tickets/storage.rb:32:inget_session_for_service_ticket' rubycas-client (2.3.9) lib/casclient/tickets/storage.rb:13:in process_single_sign_out' rubycas-client (2.3.9) lib/casclient/frameworks/rails/filter.rb:300:insingle_sign_out' rubycas-client (2.3.9) lib/casclient/frameworks/rails/filter.rb:28:in `filter' . .

.

Which is correct because there will not be any sessions table if ActiveRecord::SessionStore is not used

Ref: https://wiki.jasig.org/display/CASUM/Single+Sign+Out

su-docker commented 11 years ago

Noticed that my change is adding dependency to Rails. Closing it and will submit a different patch