Unable to make Saml Authentication request from Angular

0
Hi, We have an application built using Angular as the front end and C# REst API as the backend. Trying to send a SAML Authentication Request for SP Initiated SSO but it is not working. This is the API code: AuthnRequest authnRequest = new AuthnRequest(); authnRequest.Destination = strIDPURL; authnRequest.Issuer = new Issuer(Request.RequestUri.AbsoluteUri.ToString()); authnRequest.ForceAuthn = false; authnRequest.NameIdPolicy = new NameIdPolicy(null, null, true); authnRequest.ProviderName = strProvider; authnRequest.ProtocolBinding = strBinding; authnRequest.AssertionConsumerServiceUrl = assertionConsumerServiceUrl; CryptoConfig.AddAlgorithm(typeof(RSAPKCS1SHA256SignatureDescription), "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"); // Get the certificate X509Certificate2 x509Certificate = (X509Certificate2)SSOConfig.SPCert; // Sign the authentication request. RSACryptoServiceProvider SigningKey = new RSACryptoServiceProvider(); authnRequest.Sign(SigningKey, x509Certificate); string idpUrl = string.Format("{0}?{1}={2}",strIDPURL, "binding", HttpUtility.UrlEncode(strBinding)); string spResourceUrl = Request.RequestUri.AbsoluteUri.ToString(); string relayState = Guid.NewGuid().ToString(); SamlSettings.CacheProvider.Insert(relayState, spResourceUrl, new TimeSpan(1, 0, 0)); authnRequest.SendHttpPost(HttpContext.Current.Response, idpUrl, relayState); **Getting the following error on the Angular subscribe method on the Front end.** Unexpected token < in JSON at position 0 Your browser does not support JavaScript. Please press the Continue button to proceed. Please advise
edited 4/8/2020 8:41:50 AM
asked 3/27/2020 6:03:23 PM
add a comment

1 Answers

0
No, SAML is supposed to be on a webpage.
 
answered 4/8/2020 8:42:44 AM
add a comment

Your Answer

Not the answer you're looking for? Browse other questions tagged saml or ask your own question.