我如何向身份提供者提供 username/email 以预先填写在 IdP 的用户名框中?
How can I provide the username/email to the identity provider to be pre-filled in the IdP’s username box?
我正在使用 itfoxtec-identity-saml2 库与 OneLogin SSO 集成,那么如何将 username/email 发送到身份提供商以预填到 IdP 的用户名框中?
我知道我们可以在从 SP 发送到 Idp 的 AuthnRequest 消息中使用可选的 Subject/NameID 字段来从 Idp 请求特定主题。你们有没有使用 ITfoxtec SAML 2.0 MVC 完成此操作?
当前的 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();
}
*更新*
Version 4.0.0 已发布,支持带有 NameID 的主题。
我正在使用 itfoxtec-identity-saml2 库与 OneLogin SSO 集成,那么如何将 username/email 发送到身份提供商以预填到 IdP 的用户名框中? 我知道我们可以在从 SP 发送到 Idp 的 AuthnRequest 消息中使用可选的 Subject/NameID 字段来从 Idp 请求特定主题。你们有没有使用 ITfoxtec SAML 2.0 MVC 完成此操作?
当前的 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();
}
*更新*
Version 4.0.0 已发布,支持带有 NameID 的主题。