3

What is the best approach to achieve saml2.0 in ASP.NetCore2.1 MVC application?

i am using Sustainsys.AspNetCore2.1Saml2 nuget, below is code. but the EntityId in it requires System.IdentityModel.dll 4.0 sounds like i am not able to run the application it shows below error.

Code

 services.AddAuthentication()
           .AddSaml2(options =>
           {
               options.SPOptions.EntityId = new EntityId("https://localhost:44349/Saml2");
               options.IdentityProviders.Add(
                   new IdentityProvider(
                       new EntityId("http://localhost:59410//Metadata"), options.SPOptions)
                   {
                       LoadMetadata = true
                   });

               options.SPOptions.ServiceCertificates.Add(new X509Certificate2("Sustainsys.Saml2.Tests.pfx"));
           });

i am getting below error

enter image description here

Anders Revsgaard
  • 3,636
  • 1
  • 9
  • 25

1 Answers1

0

You can support SAML 2.0 in ASP.NET Core 2.1 by using ITfoxtec Identity Saml2. NuGet package: https://www.nuget.org/packages/ITfoxtec.Identity.Saml2.MvcCore/

Project https://itfoxtec.com/IdentitySaml2 and code samples https://github.com/ITfoxtec/ITfoxtec.Identity.Saml2/tree/master/test

Anders Revsgaard
  • 3,636
  • 1
  • 9
  • 25