9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/saml/bindings/http_redirect.rb', line 9
def build_request(rack_response, endpoint, saml_request, relay_state=nil)
unless relay_state.nil?
raise ArgumentError.new("relay_state must not exceed 80 bytes") if relay_state.bytesize > 80
end
request = saml_request.to_xml.to_s
deflated_saml_request = deflate(request)
query = "SAMLRequest=#{deflated_saml_request}"
query += "&RelayState=#{url_enc(relay_state)}" unless relay_state.nil?
url = "#{endpoint.location}?#{query}"
rack_response.redirect url
end
|