lib/verify/service_provider.rb
# Makes a request to the Verify Service Provider to translate a SAML
# response returned by Verify, as described here:
#
#   https://www.docs.verify.service.gov.uk/get-started/set-up-successful-verification-journey/#request-to-translate-the-saml-response
#
# The SAML response is the payload representing the result of the Verify
# identity assurance attempt by the user.
#
# Returns the translated response as a Hash, for example:
#
#   {
#       "scenario" => "IDENTITY_VERIFIED",
#       "pid" => "etikgj3ewowe",
#       "levelOfAssurance" => "LEVEL_2",
#       "attributes" => {...}
#   }
#
# Raises Verify::ResponseError if the VSP responds with an error response.
Makes a request to the Verify Service Provider to translate a SAML
response returned by Verify, as described here.



The SAML response is the payload representing the result of the Verify
identity assurance attempt by the user.

Returns the translated response as a Hash, for example.



Raises Verify::ResponseError if the VSP responds with an error response.
Makes a request to the Verify Service Provider to translate a SAML response returned by Verify as described here . The SAML response is the payload representing the result of the Verify identity assurance attempt by the user . Returns the translated response as a Hash for example . Raises Verify :: ResponseError if the VSP responds with an error response .
def translate_response(saml_response, request_id, level_of_assurance)
      uri = URI(self.class.translate_response_url)
      request = Net::HTTP::Post.new(uri)
      request.body = {"samlResponse" => saml_response, "requestId" => request_id, "levelOfAssurance" => level_of_assurance}.to_json
      request.content_type = "application/json"
      response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri_uses_ssl?(uri)) { |http| http.request(request) }
      handle_response response.body
    end
def translate_response ( saml_response , request_id , level_of_assurance ) uri = URI ( self . class . translate_response_url ) request = Net :: HTTP :: Post . new ( uri ) request . body = { "samlResponse" => saml_response , "requestId" => request_id , "levelOfAssurance" => level_of_assurance } . to_json request . content_type = "application/json" response = Net :: HTTP . start ( uri . hostname , uri . port , use_ssl : uri_uses_ssl? ( uri ) ) { | http | http . request ( request ) } handle_response response . body end
Makes a request to the Verify Service Provider to translate a SAML
response returned by Verify, as described here:
Makes a request to the Verify Service Provider to translate a SAML response returned by Verify as described here :
saml_response
request_id
level_of_assurance