Closed gwalingarj closed 1 year ago
.AddSaml2(samlOptions => {
CryptoConfig.AddAlgorithm(typeof(RsaPkCs1Sha256SignatureDescription), System.Security.Cryptography.Xml.SignedXml.XmlDsigRSASHA256Url); CryptoConfig.AddAlgorithm(typeof(RsaPkCs1Sha1SignatureDescription), System.Security.Cryptography.Xml.SignedXml.XmlDsigRSASHA1Url); samlOptions.SPOptions.EntityId = new EntityId("https://localhost:7094/Saml2/Acs"); samlOptions.SPOptions.ReturnUrl = new Uri("https://localhost:7094/Saml2/Acs"); samlOptions.SPOptions.RequestedAuthnContext = new Saml2RequestedAuthnContext( new("urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport"), new AuthnContextComparisonType()); samlOptions.SPOptions.AuthenticateRequestSigningBehavior = SigningBehavior.Always; samlOptions.SPOptions.ServiceCertificates.Add(new X509Certificate2("Sustainsys.Saml2.Tests.pfx")); samlOptions.SPOptions.WantAssertionsSigned = true; samlOptions.SPOptions.OutboundSigningAlgorithm = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"; samlOptions.SPOptions.MinIncomingSigningAlgorithm = "http://www.w3.org/2000/09/xmldsig#rsa-sha1";
The Identity Provider needs to be configured to accept that Acs url.
.AddSaml2(samlOptions => {