Module: Devise

Defined in:
lib/devise_cas_authenticatable.rb,
lib/devise_cas_authenticatable/model.rb,
lib/devise_cas_authenticatable/schema.rb,
lib/devise_cas_authenticatable/strategy.rb,
lib/devise_cas_authenticatable/cas_action_url_factory_base.rb

Defined Under Namespace

Modules: Models, Schema, Strategies Classes: CasActionUrlFactoryBase, CasSessionsController

Constant Summary collapse

@@cas_base_url =

The base URL of the CAS server. For example, cas.example.com. Specifying this is mandatory.

nil
@@cas_login_url =

The login URL of the CAS server. If undefined, will default based on cas_base_url.

nil
@@cas_logout_url =

The login URL of the CAS server. If undefined, will default based on cas_base_url.

nil
@@cas_validate_url =

The login URL of the CAS server. If undefined, will default based on cas_base_url.

nil
@@cas_destination_url =

The destination url for logout.

nil
@@cas_follow_url =

The follow url for logout.

nil
@@cas_logout_url_param =

Which url to send with logout, destination or follow. Can either be nil, destination or follow.

nil
@@cas_enable_single_sign_out =

Should devise_cas_authenticatable enable single-sign-out? Requires use of a supported session_store. Currently supports active_record or redis. False by default.

false
@@cas_single_sign_out_mapping_strategy =

What strategy should single sign out use for tracking token->session ID mapping. :rails_cache by default.

:rails_cache
@@cas_create_user =

Should devise_cas_authenticatable attempt to create new user records for unknown usernames? True by default.

true
@@cas_username_column =

The model attribute used for query conditions. Should be the same as the rubycas-server username_column. :username by default

:username
@@cas_user_identifier =

The CAS reponse value used to find users in the local database it is required that this field be in cas_extra_attributes

nil
@@cas_destination_logout_param_name =

Name of the parameter passed in the logout query

nil
@@cas_client_config_options =

Additional options for CAS client object

{}

Class Method Summary collapse

Class Method Details

.cas_clientObject

Return a CASClient::Client instance based on configuration parameters.



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/devise_cas_authenticatable.rb', line 91

def self.cas_client
  @@cas_client ||= begin
    cas_options = {
      :cas_destination_logout_param_name => @@cas_destination_logout_param_name,
      :cas_base_url => @@cas_base_url,
      :login_url => @@cas_login_url,
      :logout_url => @@cas_logout_url,
      :validate_url => @@cas_validate_url,
      :enable_single_sign_out => @@cas_enable_single_sign_out
    }

    cas_options.merge!(@@cas_client_config_options) if @@cas_client_config_options

    CASClient::Client.new(cas_options)
  end
end

.cas_create_user?Boolean

Returns:

  • (Boolean)


86
87
88
# File 'lib/devise_cas_authenticatable.rb', line 86

def self.cas_create_user?
  cas_create_user
end

.cas_service_url(base_url, mapping) ⇒ Object



108
109
110
# File 'lib/devise_cas_authenticatable.rb', line 108

def self.cas_service_url(base_url, mapping)
  cas_action_url(base_url, mapping, "service")
end

.cas_unregistered_url(base_url, mapping) ⇒ Object



112
113
114
# File 'lib/devise_cas_authenticatable.rb', line 112

def self.cas_unregistered_url(base_url, mapping)
  cas_action_url(base_url, mapping, "unregistered")
end