Skip to content

Instantly share code, notes, and snippets.

@AlainODea
Last active January 21, 2018 22:32
Show Gist options
  • Save AlainODea/889c37155f13689829af351a9383739b to your computer and use it in GitHub Desktop.
Save AlainODea/889c37155f13689829af351a9383739b to your computer and use it in GitHub Desktop.
SAML Debugging - Pulling SAMLResponse POSTed to Okta from HAR using jq
#!/bin/bash
harFile="${1:=NetworkData.xml}"
cat "${harFile}" |
jq --raw-output --from-file har-to-SAMLResponse.jq | # get URL encoded SAMLResponse
while read; do echo -e ${REPLY//%/\\x}; done | # decode to Base64 SAMLResponse
base64 --decode # decode to XML SAMLResponse
.log.entries[].request |
select(.url == "https://example.okta.com/sso/saml2/0oa21234abcd1234abcd1234") |
.postData.params[] |
select(.name == "SAMLResponse") |
.value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment