1

We are using the ITfoxtec SAML2 library for Single Sign On with SAML2 authentication for some of our external Clients.

So far we only have one client that wants SSO, but we anticipate that we will get more clients that want to use SSO, so my question is that can we store the setting in a Database rather than read from a Configuration file. We would like to look up the values for each client from a data store and then build the SAML2 Configuration and then do the binding.

var binding = new Saml2RedirectBinding();
        binding.SetRelayStateQuery(new Dictionary<string, string> { { "RelayState", relayStateReturnUrl ?? Url.Content("~/") } });

        //The bindingResult is a SAML2 redirectBinding - this create a browser redirect to the IDP.
        var bindingResult =  binding.Bind(new Saml2AuthnRequest(_samlConfig));  

So we would build out the Saml2Configuration our selves (Or perhaps store those in a Database table and look it up based on the client. The idea is to pass in a custom SAMLConfiguration rather than reading it from the App settings. Would this approach work, would the ITfoxtec have a sample for this approach ?

Jawahar
  • 183
  • 4
  • 16

1 Answers1

0

Multible IdP and RP support is implemented in FoxIDs in the SamlConfigurationLogic.cs class. You can either implement you own version of the SAML config logic or user FoxIDs to handle the multible IdP connections for your application.

Related questions and answers:

Anders Revsgaard
  • 3,636
  • 1
  • 9
  • 25
  • 1
    Many thanks Anders for the example – Jawahar Oct 27 '22 at 10:32
  • 1
    Hi I am running into an issue where I am not able to set "AllowedAudienceUris" or SignatureValidataionCertificates as both are protected set. So to set up a Smal2Configuration for multiple clients where I am reading the values from a Db store How can one specify the ALllowedAudienceUris and SignatureValidationCertificates ? – Jawahar Nov 21 '22 at 16:55
  • You add the values to a list. saml2Configuration.AllowedAudienceUris, se https://github.com/ITfoxtec/ITfoxtec.Identity.Saml2/blob/master/test/TestWebAppCore/Startup.cs#L40. saml2Configuration.SignatureValidationCertificates, se https://github.com/ITfoxtec/ITfoxtec.Identity.Saml2/blob/master/test/TestWebAppCore/Startup.cs#L54 – Anders Revsgaard Nov 22 '22 at 09:39