在 Authn 请求中要求 NSIS 高

Require NSIS High in Authn Request

我正在使用 ITfoxtec.Identity.Saml2 包并将其连接到 Danish NemLog-in 3。 我如何在 SAML 2.0 Authn 请求中要求 NSIS 级别高?

您可以将 RequestedAuthnContext 添加到 Saml2AuthnRequest,然后添加 AuthnContextClassRef 要求 NSIS 级别高 (https://data.gov.dk/concept/core/nsis/loa/High)。
Comparison 设置为 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"
        },
    },
};

code sample is from the TestWebAppCoreNemLogin3Sp 使用 NemLog-in 3 配置的示例应用程序,展示了如何实现 NemLog-in 3 服务提供商。