我使用本指南为 ADFS 构建了 MFA 扩展:https ://blogs.msdn.microsoft.com/jenfieldmsft/2014/03/24/build-your-own-external-authentication-provider-for-ad-fs-在-windows-server-2012-r2-walk-through-part-1/
我正在尝试获取传入的声明以获取IAuthenticationAdapter.BeginAuthentication(Claim claim, ...)
正在验证的用户的电子邮件。根据指南,我应该能够在我的元数据中指定IdentityClaims
要返回的内容"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"
,然后我应该会收到电子邮件。
但是,我的代码永远不会被击中。
相反,我在事件查看器日志中收到以下错误:
System.IO.InvalidDataException: The identity information provided does not contain a Windows account name.
at Microsoft.IdentityServer.Web.Authentication.External.ExternalAuthenticationHandler.ProcessContext(ProtocolContext context, IAuthenticationContext authContext, IAccountStoreUserData userData)
at Microsoft.IdentityServer.Web.Authentication.External.ExternalAuthenticationHandler.Process(ProtocolContext context)
at Microsoft.IdentityServer.Web.Authentication.AuthenticationOptionsHandler.Process(ProtocolContext context)
at Microsoft.IdentityServer.Web.PassiveProtocolListener.OnGetContext(WrappedHttpListenerContext context)
我尝试指定依赖方信任以传递 LDAP 参数,但我无法在我的代码中访问这些参数。
有什么建议么?