Class: OmniAuth::Strategies::CAS::ServiceTicketValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/mumukit/login/provider/cas.rb

Instance Method Summary collapse

Instance Method Details

#get_service_response_bodyObject



17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/mumukit/login/provider/cas.rb', line 17

def get_service_response_body
  result = ''
  http = Net::HTTP.new(@uri.host, @uri.port)
  http.use_ssl = @uri.port == 443 || @uri.instance_of?(URI::HTTPS)
  if http.use_ssl?
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE if @options.disable_ssl_verification?
    http.cert = @options.ssl_certificate.try { |it| OpenSSL::X509::Certificate.new it }
  end
  http.start do |c|
    response = c.get "#{@uri.path}?#{@uri.query}", VALIDATION_REQUEST_HEADERS.dup
    result = response.body
  end
  result
end