1

I'm using the ITfoxtec.Identity.Saml2 package and have it connected to the Danish NemLog-in 3. How do I require the NSIS level High in a SAML 2.0 Authn Request?

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

1 Answers1

1

You can add a RequestedAuthnContext to the Saml2AuthnRequest and with that add a AuthnContextClassRef requiring the NSIS level High (https://data.gov.dk/concept/core/nsis/loa/High).
Set the Comparison to Minimum.

var saml2AuthnRequest = new Saml2AuthnRequest(config)
{
    RequestedAuthnContext = new RequestedAuthnContext
    {
        Comparison = AuthnContextComparisonTypes.Minimum,
        AuthnContextClassRef = new string[]
        {
            //"https://data.gov.dk/concept/core/nsis/loa/Low"
            //"https://data.gov.dk/concept/core/nsis/loa/Substantial",
            "https://data.gov.dk/concept/core/nsis/loa/High"
        },
    },
};

The code sample is from the TestWebAppCoreNemLogin3Sp sample application which is configured with NemLog-in 3 and show how to implement a NemLog-in 3 Service Provider.

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