I am using ionic to build an app that requires SAML Authentication, does anyone have some guidance on this topic??
Currently I am able to send a username and password to the API I need to hit and get back a SAML Assertion, however I haven’t found a solution with Ionic or Angular to grab the SAML token and sign in url that the response sends back as HTML . Also once I can grab that data, I will need a way to parse the xml to collect the user data. I have tried: - grabbing each element by attribute name using angular.element(document).find("input[name='SAMLResponse']”)) - RESULT - cannot find the element - using xml2json to parse SAML token response and grab the token and url - RESULT - object returned equals null
I appreciate any guidance you can offer! Thx!
sample response:
<html>\r\n<HEAD><META HTTP-EQUIV='PRAGMA' CONTENT='NO-CACHE'>
<META HTTP-EQUIV='CACHE-CONTROL' CONTENT='NO-CACHE'><TITLE>SAML 2.0 Auto-POST form</TITLE></HEAD>\r\n <body onLoad=\"document.forms[0].submit()\">\r\n
<NOSCRIPT>Your browser does not support JavaScript. Please click the 'Continue' button below to proceed. <br><br></NOSCRIPT>\r\n
<form action=\"https://foobar.url.com/sso/verify/foobar\" method=\"POST\">\r\n<input type=\"hidden\"
name=\"SAMLResponse\" value=\"SAML ASSERTION\">\r\n
<NOSCRIPT><INPUT TYPE=\"SUBMIT\" VALUE=\"Continue\"></NOSCRIPT>\r\n
</form>\r\n </body>\r\n</html>\r\n