Could Someone Give me Advice with Implementing SAML SSO with ASP.NET Core?

Hello there, :wave:

I am currently working on integrating Single Sign-On functionality into an ASP.NET Core application using SAML 2.0; and I have encountered a few challenges that I hope someone here can help me with. Specifically; I am using the ComponentSpace SAML library for this purpose; but I am running into issues with configuring the service provider (SP) and identity provider (IdP) correctly.

Set up the SAML configuration in the appsettings.json file; including the metadata URL for the IdP and the necessary certificates. Created the SAML authentication middleware in my Startup.cs and mapped the appropriate routes for login, logout, and the SAML callback. Attempted to generate and process the SAML request and response.

Although; I am running into issues where the authentication flow fails at the SAML response stage. The specific error I am seeing is: SAML response could not be parsed. I have checked the XML structure of the response, and it seems to be valid, but it appears the library is unable to interpret it correctly.

Also, I have gone through this post; https://forum.componentspace.com/t/issue-with-ssl-certificate-configuration-on-iis-generative-ai which definitely helped me out a lot.

I have followed the documentation provided by ComponentSpace; but I suspect there might be a configuration issue I am missing; particularly with the bindings or certificates. Has anyone here successfully implemented SAML SSO with ComponentSpace in an ASP.NET Core project? :thinking:

Thanks in advance for your help and assistance. :innocent:

Most issues are the result of mismatching configuration. However, failing to parse a SAML response is a more fundamental issue.

Are you certain it’s an HTTP Post of a SAML response that’s being received at the assertion consumer service endpoint?

How did you retrieve the SAML response XML to check its syntax?

If there’s still an issue, please enable SAML trace and send the generated log file as an email attachment to support@componentspace.com mentioning your forum post.

The log will show exactly what’s being received and why it can’t be processed successfully.