summaryrefslogtreecommitdiff
path: root/config/initializers/devise.rb
diff options
context:
space:
mode:
authortduehr <tduehr@gmail.com>2015-11-11 22:25:31 -0600
committertduehr <tduehr@gmail.com>2015-12-14 21:43:41 -0600
commit8e3f1fa629a61741282214b293c1bc9438aada59 (patch)
tree59b128b1297955f38e895be422c9362115fd13ef /config/initializers/devise.rb
parent2b4a3bc524c0db3f6e4e3d2b2f34ec29e358b240 (diff)
downloadgitlab-ce-8e3f1fa629a61741282214b293c1bc9438aada59.tar.gz
add CAS authentication support
Diffstat (limited to 'config/initializers/devise.rb')
-rw-r--r--config/initializers/devise.rb10
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