Class: Saml::Bindings::HTTPPost
- Inherits:
-
Object
- Object
- Saml::Bindings::HTTPPost
- Includes:
- Notification
- Defined in:
- lib/saml/bindings/http_post.rb
Class Method Summary collapse
Methods included from Notification
Class Method Details
.create_form_attributes(message, options = {}) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/saml/bindings/http_post.rb', line 7 def create_form_attributes(, = {}) param = .is_a?(Saml::ComplexTypes::StatusResponseType) ? "SAMLResponse" : "SAMLRequest" xml = notify('create_message', Saml::Util.sign_xml()) variables = {} variables[param] = Saml::Encoding.encode_64(xml) variables["RelayState"] = [:relay_state] if [:relay_state] { location: .destination, variables: variables } end |
.receive_message(request, type) ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/saml/bindings/http_post.rb', line 22 def (request, type) = Saml::Encoding.decode_64(request.params["SAMLRequest"] || request.params["SAMLResponse"]) notify('receive_message', ) request_or_response = Saml.(, type) verified_request_or_response = Saml::Util.verify_xml(request_or_response, ) verified_request_or_response.actual_destination = request.url verified_request_or_response end |