diff options
| author | mo <mo.khan@gmail.com> | 2018-02-03 17:59:26 -0700 |
|---|---|---|
| committer | mo <mo.khan@gmail.com> | 2018-02-03 17:59:26 -0700 |
| commit | 564f4eca53eb3757c635a8112f482d6cd24df00c (patch) | |
| tree | 2270a25c1310453ca3decc5c1bd23ed2c9377fc4 | |
| parent | 519a33e698dde5ddff888a9d35bbd4e4a847d12f (diff) | |
decode using http post bindingv0.1.0
| -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 |
