{"id":4394,"date":"2025-03-20T15:20:28","date_gmt":"2025-03-20T15:20:28","guid":{"rendered":"https:\/\/geekmungus.co.uk\/?p=4394"},"modified":"2025-03-20T15:20:29","modified_gmt":"2025-03-20T15:20:29","slug":"saml-request-debugging-and-rewriting","status":"publish","type":"post","link":"https:\/\/geekmungus.co.uk\/?p=4394","title":{"rendered":"SAML Request Debugging and Rewriting"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Although it may not be useful to most unless you are using the OpenAthens with Shibboleth IdP, I though  running through some SAML request debugging which shows how you can take apart a SAML request, rewrite it and then re-encode it to assist in debugging or testing. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The purpose of this was to test the SAML attributes that were being exposed to sP (service providers) from our new OpenAthens deployment to verify it was working as expected.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Essentially you&#8217;re going through the process of:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Initial request<\/li>\n\n\n\n<li>Decode the URL<\/li>\n\n\n\n<li>Decode the XML<\/li>\n\n\n\n<li>Change the XML (to include your new IdP)<\/li>\n\n\n\n<li>Encode the XML<\/li>\n\n\n\n<li>Encode the URL<\/li>\n\n\n\n<li>Make the request (with the modified SAML request)<\/li>\n\n\n\n<li>Output<\/li>\n<\/ol>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"OpenAthensTestingSAMLRequests-PerformingtheTests\">Performing the Tests<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Open an incognito or private browser window.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Open the Developer Tools, and go to the &#8220;network&#8221; tab so you are able to see each of the resources (and requests) that are being made.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The open Athens IdP Endpoint is at the link: <a href=\"https:\/\/login.openathens.net\/saml\/2\/sso\/domain.com\">https:\/\/login.openathens.net\/saml\/2\/sso\/domain.com<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The new prefix for the modified SAML requests: <a href=\"https:\/\/login.openathens.net\/saml\/2\/sso\/domain.com\/c\/ukfed?SAMLRequest=\">https:\/\/login.openathens.net\/saml\/2\/sso\/domain.com\/c\/ukfed?SAMLRequest=<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Note that i&#8217;m hiding the our real IdP name, so using the fake one: idp.domain.com, so you&#8217;d need to substitute in your own.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"OpenAthensTestingSAMLRequests-InitialRequest\">Initial Request<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">First open this page&nbsp;<a href=\"https:\/\/login.openathens.net\/resources\/static\/ssodebug.html\">https:\/\/login.openathens.net\/resources\/static\/ssodebug.html<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Click the&nbsp;OpenAthens SSO&nbsp;Debug button<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"532\" height=\"101\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-4.png\" alt=\"\" class=\"wp-image-4395\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-4.png 532w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-4-300x57.png 300w\" sizes=\"auto, (max-width: 532px) 100vw, 532px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This will set the OpenAthens logon page into Debug Mode, what this means is you&#8217;ll see a splash page displaying debug information such as the attribtues that your IdP has released to OpenAthens so you can check what they are.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then open a new tab and go to the UK federation test SP&nbsp;<a href=\"https:\/\/www.ukfederation.org.uk\/content\/Documents\/TestSPHome\">https:\/\/www.ukfederation.org.uk\/content\/Documents\/TestSPHome<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Note that you need to be part of the UK Federation, you&#8217;ll also need to have statically configured the sP within OpenAthens so you can send requests to that directly.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"759\" height=\"718\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-5.png\" alt=\"\" class=\"wp-image-4396\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-5.png 759w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-5-300x284.png 300w\" sizes=\"auto, (max-width: 759px) 100vw, 759px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Click the link shown in the box <a class=\"\" href=\"https:\/\/test.ukfederation.org.uk\/Shibboleth.sso\/SeamlessAccess\">https:\/\/test.ukfederation.org.uk\/Shibboleth.sso\/SeamlessAccess<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">From the list start typing your organisation name, then click on it to take you to your current IdP login, in our example this is Shibboleth IdP which is being retired in favour of OpenAthens backed by OKTA to provide the directory information.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">At the Shibboleth IdP, don&#8217;t log in, instead look into the Developer Tools window, specifically the &#8220;Network&#8221; tab.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"643\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-6-1024x643.png\" alt=\"\" class=\"wp-image-4397\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-6-1024x643.png 1024w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-6-300x188.png 300w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-6-768x482.png 768w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-6-1536x964.png 1536w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-6.png 1891w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Then a few parts of the output need to be removed.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:&#47;&#47;idp.domain.com\/idp\/profile\/SAML2\/Redirect\/SSO?SAMLRequest=hZLNbsIwEIRfJfKdOCRQwCJIKRyKRAsitIdeKsfZgFVjp16nP29fJ1CVXuh1PfOtZ7RT5EdVs6xxB72FtwbQBZ9HpZF1DylprGaGo0Sm%2BRGQOcHy7H7F4jBitTXOCKNIkCGCddLoudHYHMHmYN%2BlgMftKiUH52pklDoPD5vXCkqwvBWHxu79gOYHWRRGgTuEiIa2%2FJhu1vmOBAvvkbpT%2F4JkWYfI9R5syEUL8APqP1NJBWf3FkppQTia52sSLBcpeSnKwaQqbkYTSEbjQiSjJIr5RAwH1XhUlP3SyxAbWGp0XLuUxFE87EVJrz%2FY9YcsGrA4eibB5pz5VupS6v31goqTCNndbrfpnRI9gcUujReQ2bStmXWL7UXx17H8p20y%2B7db0E66rym92HNaWrMHD14uNkZJ8RVkSpmPuQXuICV9Qmcny9%2FTmH0D&amp;RelayState=cookie%3A1741964658_547c<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Remove from the beginning:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:&#47;&#47;idp.domain.com\/idp\/profile\/SAML2\/Redirect\/SSO?SAMLRequest=<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Remove from the end:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&amp;RelayState=cookie%3A1741964658_547c<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"90\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-7-1024x90.png\" alt=\"\" class=\"wp-image-4398\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-7-1024x90.png 1024w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-7-300x26.png 300w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-7-768x67.png 768w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-7.png 1189w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">So it looks like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>hZLNbsIwEIRfJfKdOCRQwCJIKRyKRAsitIdeKsfZgFVjp16nP29fJ1CVXuh1PfOtZ7RT5EdVs6xxB72FtwbQBZ9HpZF1DylprGaGo0Sm%2BRGQOcHy7H7F4jBitTXOCKNIkCGCddLoudHYHMHmYN%2BlgMftKiUH52pklDoPD5vXCkqwvBWHxu79gOYHWRRGgTuEiIa2%2FJhu1vmOBAvvkbpT%2F4JkWYfI9R5syEUL8APqP1NJBWf3FkppQTia52sSLBcpeSnKwaQqbkYTSEbjQiSjJIr5RAwH1XhUlP3SyxAbWGp0XLuUxFE87EVJrz%2FY9YcsGrA4eibB5pz5VupS6v31goqTCNndbrfpnRI9gcUujReQ2bStmXWL7UXx17H8p20y%2B7db0E66rym92HNaWrMHD14uNkZJ8RVkSpmPuQXuICV9Qmcny9%2FTmH0D<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"OpenAthensTestingSAMLRequests-DecodeTheURL\">Decode The URL<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Then in another tab, open the page&nbsp;<a href=\"https:\/\/www.samltool.com\/url.php\">https:\/\/www.samltool.com\/url.php<\/a>&nbsp;(URL Encode\/Decode) that allows you to decode the URL.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"630\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-8-1024x630.png\" alt=\"\" class=\"wp-image-4399\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-8-1024x630.png 1024w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-8-300x185.png 300w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-8-768x472.png 768w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-8.png 1504w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">In the URL Decode box paste the above into the data to be URL decoded:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"287\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-9-1024x287.png\" alt=\"\" class=\"wp-image-4400\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-9-1024x287.png 1024w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-9-300x84.png 300w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-9-768x215.png 768w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-9.png 1153w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Then click the\u00a0<strong>URL DECODE DATA<\/strong>\u00a0button and the following should be outputted.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"255\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-10-1024x255.png\" alt=\"\" class=\"wp-image-4401\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-10-1024x255.png 1024w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-10-300x75.png 300w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-10-768x191.png 768w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-10.png 1137w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Then take the output from the right and go to the Base 64 Decode + Inflate link, paste the output into the Deflate and Encoded XML.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"OpenAthensTestingSAMLRequests-DecodeTheXML\">Decode The XML<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Next go to the page&nbsp;<a href=\"https:\/\/www.samltool.com\/decode.php\">https:\/\/www.samltool.com\/decode.php<\/a>&nbsp;(Base 64 Decode + Inflate).<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"230\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-11-1024x230.png\" alt=\"\" class=\"wp-image-4402\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-11-1024x230.png 1024w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-11-300x68.png 300w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-11-768x173.png 768w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-11.png 1222w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Then click the\u00a0<strong>DECODE AND INFLATE XML\u00a0<\/strong>button and the following should be output.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"868\" height=\"758\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-12.png\" alt=\"\" class=\"wp-image-4403\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-12.png 868w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-12-300x262.png 300w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-12-768x671.png 768w\" sizes=\"auto, (max-width: 868px) 100vw, 868px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"OpenAthensTestingSAMLRequests-ChangeTheXML\">Change The XML<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Take the output in the box and replace the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:&#47;&#47;idp.sanger.ac.uk\/idp\/profile\/SAML2\/Redirect\/SSO<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:&#47;&#47;login.openathens.net\/saml\/2\/sso\/sanger.ac.uk\/c\/ukfed<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After the change it should look something like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;samlp:AuthnRequest xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\" AssertionConsumerServiceURL=\"https:\/\/test.ukfederation.org.uk\/Shibboleth.sso\/SAML2\/POST\" Destination=\"https:\/\/login.openathens.net\/saml\/2\/sso\/domain.com\/c\/ukfed\" ID=\"_bd49fb679e378bc37302a9c54f87bd1d\" IssueInstant=\"2025-03-14T15:04:20Z\" ProtocolBinding=\"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST\" Version=\"2.0\">&lt;saml:Issuer xmlns:saml=\"urn:oasis:names:tc:SAML:2.0:assertion\">https:\/\/test.ukfederation.org.uk\/entity&lt;\/saml:Issuer>&lt;samlp:NameIDPolicy AllowCreate=\"1\"\/>&lt;\/samlp:AuthnRequest>\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">We are rewriting the request to include the OpenAthens IdP rather than our current IdP to allow us to perform a test.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"OpenAthensTestingSAMLRequests-EncodeTheXML\">Encode The XML<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The click the link&nbsp;<a href=\"https:\/\/www.samltool.com\/encode.php\">https:\/\/www.samltool.com\/encode.php<\/a>&nbsp;(Deflate + Base64 Encode), now you need to paste in your altered XML from the previous step.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"540\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-13-1024x540.png\" alt=\"\" class=\"wp-image-4404\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-13-1024x540.png 1024w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-13-300x158.png 300w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-13-768x405.png 768w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-13.png 1226w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Then click the\u00a0<strong>DEFLATE\u00a0AND ENCODE XML<\/strong>, which should output the following:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"863\" height=\"762\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-14.png\" alt=\"\" class=\"wp-image-4405\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-14.png 863w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-14-300x265.png 300w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-14-768x678.png 768w\" sizes=\"auto, (max-width: 863px) 100vw, 863px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"OpenAthensTestingSAMLRequests-EncodeTheURL\">Encode The URL<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Next we need to go to the link&nbsp;<a href=\"https:\/\/www.samltool.com\/url.php\">https:\/\/www.samltool.com\/url.php<\/a>&nbsp;(URL Encode\/Decode) again, but this time we&#8217;ll be encoding the data, rather than decoding which we did earlier.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Paste the above text into the URL Encode box:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"372\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-15-1024x372.png\" alt=\"\" class=\"wp-image-4406\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-15-1024x372.png 1024w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-15-300x109.png 300w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-15-768x279.png 768w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-15-1536x558.png 1536w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-15.png 1627w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Click the <strong>URL ENCODE DATA<\/strong> button.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After this has been processed you have your encoded output:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"260\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-16-1024x260.png\" alt=\"\" class=\"wp-image-4407\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-16-1024x260.png 1024w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-16-300x76.png 300w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-16-768x195.png 768w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-16.png 1148w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"OpenAthensTestingSAMLRequests-MakeTheRequest\">Make The Request<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Copy the output and then create the following URL by taking the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:&#47;&#47;login.openathens.net\/saml\/2\/sso\/domain.com\/c\/ukfed?SAMLRequest=<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Append encoded XML to it to create the following URL:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ttps:\/\/login.openathens.net\/saml\/2\/sso\/domain.com\/c\/ukfed?SAMLRequest=hZJBU8IwEIX%2FSid3miZQgQztDMJBZlAZQA9enLRdacaS1Gyq8u9NWx3xgtfs2%2B%2Fte5MZymNVi3njSr2FtwbQBZ%2FHSqPoBglprBZGokKh5RFQuFzs5rdrwcNI1NY4k5uKBHNEsE4ZvTAamyPYHdh3lcPDdp2Q0rkaBaXOw8Pm9QUKsLIVh8Ye%2FAPdlSrLTAWuDBENbfmcbu53exIs%2FY7SnfoXVJmD8ss1%2BEEJGkMNjrb3Uk5bAEp9ABvKvIXntLMkwWqZkOeiiKIpH03ZhE2nw%2BwK5GTMh0M%2B5jGbjNjIyxAbWGl0UruE8IjHg2g4YKM9i0XMRBw9kWDzHfxa6ULpw%2BWWsl6E4ma%2F3wz6WI9gsYvkBSSdtbeLztietX8ZK38qJ%2Bm%2FBYN2yp1m9MynN63FnQevlhtTqfwUzKvKfCwsSAcJYYSm%2Fcrf%2F5F%2BAQ%3D%3D<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Open a new browser tab, paste in your edited URL and it should now open the OKTA login page.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Sign in and once signed in, the following should be displayed.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Output\u00a0<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"963\" height=\"802\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-17.png\" alt=\"\" class=\"wp-image-4408\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-17.png 963w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-17-300x250.png 300w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2025\/03\/image-17-768x640.png 768w\" sizes=\"auto, (max-width: 963px) 100vw, 963px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The output show the attributes that are going to be passed to the application from OpenAthens.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you don&#8217;t see the above page then you may not have enabled the SSO debug using the link in Fig A above.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you were to click &#8220;Proceed to service&#8221; you&#8217;d get an error saying that the request signature is invalid, this is because you&#8217;ve tampered with the request en-route, but we don&#8217;t need to proceed to the service, its the output of this debug screen we are interested in.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Although it may not be useful to most unless you are using the OpenAthens with Shibboleth IdP, I though running through some SAML request debugging which shows how you can take apart a SAML request, rewrite it and then re-encode it to assist in debugging or testing. The purpose of this was to test the &#8230; <a title=\"SAML Request Debugging and Rewriting\" class=\"read-more\" href=\"https:\/\/geekmungus.co.uk\/?p=4394\" aria-label=\"Read more about SAML Request Debugging and Rewriting\">Read more<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35,53,22],"tags":[],"class_list":["post-4394","post","type-post","status-publish","format-standard","hentry","category-okta","category-saml","category-security"],"_links":{"self":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4394","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4394"}],"version-history":[{"count":1,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4394\/revisions"}],"predecessor-version":[{"id":4409,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4394\/revisions\/4409"}],"wp:attachment":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4394"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4394"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4394"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}