diff options
author | tduehr <tduehr@gmail.com> | 2015-11-11 22:25:31 -0600 |
---|---|---|
committer | tduehr <tduehr@gmail.com> | 2015-12-14 21:43:41 -0600 |
commit | 8e3f1fa629a61741282214b293c1bc9438aada59 (patch) | |
tree | 59b128b1297955f38e895be422c9362115fd13ef /config/initializers/devise.rb | |
parent | 2b4a3bc524c0db3f6e4e3d2b2f34ec29e358b240 (diff) | |
download | gitlab-ce-8e3f1fa629a61741282214b293c1bc9438aada59.tar.gz |
add CAS authentication support
Diffstat (limited to 'config/initializers/devise.rb')
-rw-r--r-- | config/initializers/devise.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 5fb43a86e13..92149826da7 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -241,6 +241,16 @@ Devise.setup do |config| # An Array from the configuration will be expanded. provider_arguments.concat provider['args'] when Hash + # Add procs for handling SLO + if provider['name'] == 'cas3' + provider['args'][:on_single_sign_out] = lambda do |request| + ticket = request.params[:session_index] + raise "Service Ticket not found." unless Gitlab::OAuth::Session.valid?(:cas3, ticket) + Gitlab::OAuth::Session.destroy(:cas3, ticket) + true + end + end + # A Hash from the configuration will be passed as is. provider_arguments << provider['args'].symbolize_keys end |