Class: RackCAS::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/rack-cas/server.rb

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ Server

Returns a new instance of Server.



6
7
8
# File 'lib/rack-cas/server.rb', line 6

def initialize(url)
  @url = RackCAS::URL.parse(url)
end

Instance Method Details

#login_url(service_url) ⇒ Object



10
11
12
13
# File 'lib/rack-cas/server.rb', line 10

def (service_url)
  service_url = URL.parse(service_url).to_s
  @url.dup.append_path('login').add_params(service: service_url)
end

#logout_urlObject



15
16
17
# File 'lib/rack-cas/server.rb', line 15

def logout_url
  @url.dup.append_path('logout')
end

#validate_service(service_url, ticket) ⇒ Object



19
20
21
22
# File 'lib/rack-cas/server.rb', line 19

def validate_service(service_url, ticket)
  response = ServiceValidationResponse.new validate_service_url(service_url, ticket)
  [response.user, response.extra_attributes]
end