1

我正在使用 itfoxtec-identity-saml2 库与 OneLogin SSO 集成,那么如何将用户名/电子邮件发送给身份提供者以预先填写 IdP 的用户名框?我知道我们可以使用从 SP 发送到 Idp 的 AuthnRequest 消息中的可选 Subject/NameID 字段来向 Idp 请求特定主题。你们有没有使用 ITfoxtec SAML 2.0 MVC 做到这一点?

4

1 回答 1

1

当前的 ITfoxtec Identity SAML 2.0 版本不支持带有 NameID 的 Authn Request Subject 元素。

从版本 3.1.0-beta1 https://github.com/ITfoxtec/ITfoxtec.Identity.Saml2/releases/tag/3.1.0-beta1支持具有 NameID 的主题。此测试版还增加了对 Azure Key Vault 的支持。

请让我知道测试版是否适合您。

选定的 NameID 将添加到 Saml2AuthnRequest 上的主题:

[Route("Login")]
public IActionResult Login(string returnUrl = null)
{
    var binding = new Saml2RedirectBinding();
    binding.SetRelayStateQuery(new Dictionary<string, string> { { relayStateReturnUrl, returnUrl ?? Url.Content("~/") } });

    return binding.Bind(new Saml2AuthnRequest(config)
    {
        Subject = new Subject { NameID = new NameID { ID = "abcd" } },
    }).ToActionResult();
}

* 更新 *

版本 4.0.0已发布,支持带有 NameID 的主题。

于 2019-02-25T11:13:42.617 回答