diff options
| -rw-r--r-- | lib/saml/kit/cli.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/saml/kit/cli.rb b/lib/saml/kit/cli.rb index 3bdc8cf..62c8d91 100644 --- a/lib/saml/kit/cli.rb +++ b/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 |
