Search code examples
asp.net-mvcsaml-2.0itfoxtec-identity-saml2

Can ITfoxtec SAML2 supprot multiple IdPs?


I am attempting to make my ASP.NET MVC web app provide SSO to multiple IdPs, and I am wondering if it is possible to support this scenario using the ITfoxtec.SAML2 library.

I have many different clients, several of whom want to have an SSO integration with my service. Each of the clients has a different sub-domain (e.g. business1.myapp.com, business2.myapp.com, etc.) and I will need to use their unique part of the name to look up their metadata and produce a configuration that will talk back to them.

The example code that I have seen seems to be supporting a more traditional one IdP to one SP scenario.

Additionally, if any one knows of a non-Core ASP.NET MVC example application, I would be profoundly grateful to know where to find it.


Solution

  • In your case I would implement some Saml2Configuration logic, where I can ask for a specific Saml2Configuration for the current IdP. This specific Saml2Configuration is then used in the AuthController.

    After a binding.ReadSamlResponse(Request.ToGenericHttpRequest(), saml2AuthnResponse) with a generic Saml2Configuration you can read the IdP issuer in saml2AuthnResponse.Issuer. And then load the correct Saml2Configuration.

    A link to a non-Core ASP.NET MVC relaying party sample application https://github.com/ITfoxtec/ITfoxtec.Identity.Saml2/tree/master/test/TestWebApp

    --

    An alternative solution is to add a security broker like https://www.foxids.com in between your app and the IdPs. Then the security broker handles meltable IdPs and your application only need to trust the security broker as one IdP (using SAML 2.0 or OpenID Connect). FoxIDs is also open source and free.