Class: OmniAuth::Strategies::CAS::Configuration
- Inherits:
-
Object
- Object
- OmniAuth::Strategies::CAS::Configuration
- Defined in:
- lib/omniauth/strategies/cas/configuration.rb
Constant Summary collapse
- DEFAULT_LOGIN_URL =
"%s/login"
- DEFAULT_SERVICE_VALIDATE_URL =
"%s/serviceValidate"
Instance Method Summary collapse
- #disable_ssl_verification? ⇒ Boolean
-
#initialize(params) ⇒ Configuration
constructor
A new instance of Configuration.
-
#login_url(service) ⇒ String
Build a CAS login URL from +service+.
-
#service_validate_url(service, ticket) ⇒ String
Build a service-validation URL from +service+ and +ticket+.
Constructor Details
#initialize(params) ⇒ Configuration
Returns a new instance of Configuration.
23 24 25 |
# File 'lib/omniauth/strategies/cas/configuration.rb', line 23 def initialize(params) parse_params params end |
Instance Method Details
#disable_ssl_verification? ⇒ Boolean
51 52 53 |
# File 'lib/omniauth/strategies/cas/configuration.rb', line 51 def disable_ssl_verification? @disable_ssl_verification end |
#login_url(service) ⇒ String
Build a CAS login URL from +service+.
32 33 34 |
# File 'lib/omniauth/strategies/cas/configuration.rb', line 32 def login_url(service) append_service @login_url, service end |
#service_validate_url(service, ticket) ⇒ String
Build a service-validation URL from +service+ and +ticket+. If +service+ has a ticket param, first remove it. URL-encode +service+ and add it and the +ticket+ as paraemters to the CAS serviceValidate URL.
45 46 47 48 49 |
# File 'lib/omniauth/strategies/cas/configuration.rb', line 45 def service_validate_url(service, ticket) service = service.sub(/[?&]ticket=[^?&]+/, '') url = append_service(@service_validate_url, service) url << '&ticket=' << Rack::Utils.escape(ticket) end |