Class: ADAL::MexRequest

Inherits:
Object
  • Object
show all
Includes:
Util
Defined in:
lib/adal/mex_request.rb

Overview

A request to a Metadata Exchange endpoint of an ADFS server. Used to obtain the WSTrust endpoint for username and password authentication of federated users.

Instance Method Summary collapse

Methods included from Util

#fail_if_arguments_nil, #http, #string_hash

Constructor Details

#initialize(endpoint) ⇒ MexRequest

Constructs a MexRequest object for a specific URL endpoint.

Parameters:

  • String|URI

    endpoint The Metadata Exchange endpoint.



41
42
43
# File 'lib/adal/mex_request.rb', line 41

def initialize(endpoint)
  @endpoint = URI.parse(endpoint.to_s)
end

Instance Method Details

#executeObject

Returns MexResponse.

Returns:

  • MexResponse



46
47
48
49
50
# File 'lib/adal/mex_request.rb', line 46

def execute
  request = Net::HTTP::Get.new(@endpoint.path)
  request.add_field('Content-Type', 'application/soap+xml')
  MexResponse.parse(http(@endpoint).request(request).body)
end