Sha256: 577f0b9399ac509cf45217b2fa24252cc9d6c55e5200e7742e0158917b4c6fbb
Contents?: true
Size: 1.45 KB
Versions: 5
Compression:
Stored size: 1.45 KB
Contents
module Saml module Bindings class HTTPArtifact class << self # @param [Saml::ArtifactResponse] artifact_response def create_response_xml(artifact_response) Saml::Util.sign_xml(artifact_response, :soap) end def create_url(location, artifact, options = {}) uri = URI.parse(location) query = [uri.query, "SAMLart=#{CGI.escape(artifact.to_s)}"] query << "RelayState=#{CGI.escape(options[:relay_state])}" if options[:relay_state] uri.query = query.compact.join("&") uri.to_s end def receive_message(request) raw_xml = request.body.dup.read artifact_resolve = Saml::ArtifactResolve.parse(raw_xml, single: true) Saml::Util.verify_xml(artifact_resolve, raw_xml) end def resolve(request, location) artifact = request.params["SAMLart"] artifact_resolve = Saml::ArtifactResolve.new(artifact: artifact, destination: location) response = Saml::Util.post(location, Saml::Util.sign_xml(artifact_resolve, :soap)) if response.code == 200 artifact_response = Saml::ArtifactResponse.parse(response.body, single: true) verified_artifact_response = Saml::Util.verify_xml(artifact_response, response.body) verified_artifact_response.response if artifact_response.success? end end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems