Sha256: fd90bfb582e24bd2c8049d81dac4ff2ca187c8963ff5490618cccd4e70bd57ac
Contents?: true
Size: 1.4 KB
Versions: 25
Compression:
Stored size: 1.4 KB
Contents
module Saml module Bindings class HTTPPost include Saml::Notification class << self def create_form_attributes(message, options = {}) param = message.is_a?(Saml::ComplexTypes::StatusResponseType) ? "SAMLResponse" : "SAMLRequest" xml = notify('create_message', Saml::Util.sign_xml(message)) variables = {} variables[param] = Saml::Encoding.encode_64(xml) variables["RelayState"] = options[:relay_state] if options[:relay_state] { location: message.destination, variables: variables } end def receive_message(request, type) message = Saml::Encoding.decode_64(request.params["SAMLRequest"] || request.params["SAMLResponse"]) notify('receive_message', message) request_or_response = Saml.parse_message(message, type) skip_signature_verification = ( request_or_response.is_a?(Saml::AuthnRequest) && !request_or_response.provider.authn_requests_signed? ) verified_request_or_response = if skip_signature_verification request_or_response else Saml::Util.verify_xml(request_or_response, message) end verified_request_or_response.actual_destination = request.url verified_request_or_response end end end end end
Version data entries
25 entries across 25 versions & 1 rubygems