Class: OmniAuth::Strategies::UocCas

Inherits:
CAS
  • Object
show all
Includes:
OmniAuth::Strategy
Defined in:
lib/omniauth/strategies/uoc_cas.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, options = {}, &block) ⇒ UocCas

Returns a new instance of UocCas.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/omniauth/strategies/uoc_cas.rb', line 8

def initialize(app, options = {}, &block)
  options = {  
   :name => :uoc_cas,
   :host => 'cv.uoc.edu',
   :login_url => '/webapps/cas/login',
   :logout_url => '/webapps/cas/logout',
   :service_validate_url => '/webapps/cas/serviceValidate',
   :name_key => 'fullName',
  }.merge(options);

  if Rails.env.staging?
    options[:host] = 'cv-pre.uoc.edu' 
    options[:disable_ssl_verification] = true
  end
  
  if Rails.env.test? or Rails.env.development?
    options[:host] = 'cv-test.uoc.edu' 
    options[:disable_ssl_verification] = true
  end 

  super(app, options, &block)
end