class Cas::Client::Server

Public Class Methods

logout_url(options={}) click to toggle source
# File lib/cas/client/server.rb, line 24
def self.logout_url(options={})
  new.logout_url(options).to_s
end
new() click to toggle source
# File lib/cas/client/server.rb, line 4
def initialize
  @url = Cas::Client::URL.new(server_url)
end

Public Instance Methods

login_url(options={}) click to toggle source
# File lib/cas/client/server.rb, line 8
def login_url(options={})
  if options.key?(:service_url)
    @url.append_path('/login').add_query("service=#{options[:service_url]}")
  else
    @url.append_path('/login')
  end
end
logout_url(options={}) click to toggle source
# File lib/cas/client/server.rb, line 16
def logout_url(options={})
  if options.key?(:service_url)
    @url.append_path('/logout').add_query("service=#{options[:service_url]}")
  else
    @url.append_path('/logout')
  end
end
validate_service(service_url, ticket) click to toggle source
# File lib/cas/client/server.rb, line 28
def validate_service(service_url, ticket)
  uri = Cas::Client::URL.new(validate_service_url(service_url, ticket)).to_uri
  res = Cas::Client::Response.new(uri)
  res.validate_service_response
  res.all_attributes
end

Protected Instance Methods

server_url() click to toggle source
# File lib/cas/client/server.rb, line 37
def server_url
  Cas::Client.configuration.server_url
end
validate_service_url(service_url, ticket) click to toggle source
# File lib/cas/client/server.rb, line 41
def validate_service_url(service_url, ticket)
  protocol_path = "p3"
  server_url = @url
  URI("#{server_url}/#{protocol_path}/serviceValidate?service=#{service_url}&ticket=#{ticket}")
end