Class: ADAL::MexRequest
- Inherits:
-
Object
- Object
- ADAL::MexRequest
- 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
-
#execute ⇒ Object
MexResponse.
-
#initialize(endpoint) ⇒ MexRequest
constructor
Constructs a MexRequest object for a specific URL endpoint.
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.
41 42 43 |
# File 'lib/adal/mex_request.rb', line 41 def initialize(endpoint) @endpoint = URI.parse(endpoint.to_s) end |
Instance Method Details
#execute ⇒ Object
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 |