Commit 564f4ec

mo <mo.khan@gmail.com>
2018-02-04 00:59:26
decode using http post binding tag: v0.1.0
1 parent 519a33e
Changed files (1)
lib
saml
lib/saml/kit/cli.rb
@@ -22,6 +22,20 @@ module Saml
           say ""
           say document.to_xml(pretty: true), :green
         end
+
+        desc "post saml", "Decodes the SAMLRequest/SAMLResponse using the HTTP Post binding"
+        def post(saml_request)
+          binding = Saml::Kit::Bindings::HttpPost.new(location: '')
+          document = binding.deserialize('SAMLRequest' => saml_request)
+          2.times { say "" }
+          say_status :success, "Decoded #{document.class}"
+          print_table [
+            ["ID", "Issuer", "Version", "Issue instant"],
+            [document.id, document.issuer, document.version, document.issue_instant.iso8601 ]
+          ]
+          say ""
+          say document.to_xml(pretty: true)
+        end
       end
 
       class Generate < Thor