SAML HTTP binding handlers.
Pure Elixir port of the Erlang esaml_binding module.
Provides encoding/decoding of SAML messages for HTTP-Redirect and HTTP-POST bindings.
Summary
Functions
Unpack and parse a SAMLResponse with the given encoding.
Encode a SAMLRequest (or SAMLResponse) as an HTTP-POST binding.
Encode a SAMLRequest (or SAMLResponse) as an HTTP-POST binding with an optional nonce for the inline script tag.
Encode a SAMLRequest (or SAMLResponse) as an HTTP-Redirect binding.
Types
Functions
Unpack and parse a SAMLResponse with the given encoding.
When the encoding is the DEFLATE URI, the response is base64-decoded then
zlib-unzipped. For any other encoding the response is base64-decoded and an
unzip is attempted, falling back to the raw decoded data if decompression
fails. The resulting XML string is then parsed with :xmerl_scan.
@spec encode_http_post( idp_target :: uri(), signed_xml :: xml(), relay_state :: binary() ) :: html_doc()
Encode a SAMLRequest (or SAMLResponse) as an HTTP-POST binding.
Returns an HTML document containing a form and JavaScript to auto-submit it.
@spec encode_http_post( idp_target :: uri(), signed_xml :: xml(), relay_state :: binary(), nonce :: binary() ) :: html_doc()
Encode a SAMLRequest (or SAMLResponse) as an HTTP-POST binding with an optional nonce for the inline script tag.
Returns an HTML document containing a form and JavaScript to auto-submit it.
@spec encode_http_redirect( idp_target :: uri(), signed_xml :: xml(), username :: nil | binary(), relay_state :: binary() ) :: binary()
Encode a SAMLRequest (or SAMLResponse) as an HTTP-Redirect binding.
Returns the full redirect URI including query parameters for SAMLEncoding,
the payload (as SAMLRequest or SAMLResponse depending on the XML root
element), RelayState, and an optional username.