我收到了在ADFS跟踪-调试项下记录的错误:
ServiceHostManager.LogFailedAuthenticationInfo: Token of type 'http://schemas.microsoft.com/ws/2006/05/identitymodel/tokens/UserName' validation failed with following exception details:
System.ArgumentOutOfRangeException: Not a valid Win32 FileTime.
Parameter name: fileTime
at System.DateTime.FromFileTimeUtc(Int64 fileTime)
at Microsoft.IdentityServer.Service.Tokens.LsaLogonUserHelper.GetPasswordExpiryDetails(SafeLsaReturnBufferHandle profileHandle, DateTime& nextPasswordChange, DateTime& lastPasswordChange)
at Microsoft.IdentityServer.Service.Tokens.LsaLogonUserHelper.GetLsaLogonUserInfo(SafeHGlobalHandle pLogonInfo, Int32 logonInfoSize, DateTime& nextPasswordChange, DateTime& lastPasswordChange, String authenticationType, String issuerName)
at Microsoft.IdentityServer.Service.Tokens.LsaLogonUserHelper.GetLsaLogonUser(UserNameSecurityToken token, DateTime& nextPasswordChange, DateTime& lastPasswordChange, String issuerName)
at Microsoft.IdentityServer.Service.Tokens.MSISWindowsUserNameSecurityTokenHandler.ValidateTokenInternal(SecurityToken token)
at Microsoft.IdentityServer.Service.Tokens.MSISWindowsUserNameSecurityTokenHandler.ValidateToken(SecurityToken token)我试图用被动身份验证来编写概念C#服务提供者的简单证明。
从C# SP,我创建了一个SAMLRequest,并将浏览器重定向到ADFS。
ADFS提示输入表单凭据,当输入时,在此状态下回发到我的SAML2.0资源使用者:
<samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Responder"/>我为这个依赖方制定了两条索赔规则。
c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname", Issuer == "AD AUTHORITY"]
=> issue(store = "Active Directory", types = ("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"), query = ";mail;{0}", param = c.Value);和
c:[Type == "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"]
=> issue(Type = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", Issuer = c.Issuer, OriginalIssuer = c.OriginalIssuer, Value = c.Value, ValueType = c.ValueType, Properties["http://schemas.xmlsoap.org/ws/2005/05/identity/claimproperties/format"] = "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified");我对“非有效的Win32 FileTime”异常感到非常困惑,因为它看起来好像是ADFS深处的某个东西试图将某个东西当作一个时间戳,而这个时间戳显然没有有效的时间戳。
这是从Azure模板创建的Windows 2012 R2数据中心版本服务器。我对它所做的就是为测试目的安装ADFS和AD。
我并不认为这会产生影响,但服务器时区默认为UTC。
发布于 2015-08-04 23:42:38
事实证明,"Not a valid Win32 FileTime“的例外是一条红鲱鱼。第二天,当我用这些声明进行测试时,我得到了以下状态代码:
<samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:InvalidNameIDPolicy"/>当我得到Win32 FileTime错误时,一定是无意中配置了一些垃圾声明。
深入研究InvalidNameIDPolicy状态,我注意到请求中的NameID格式是:
urn:oasis:names:tc:SAML:2.0:nameid-format:unspecified这似乎是无效的,或者是ADFS无法识别的。切换到请求指定以下NameID格式策略解决了这个问题:
urn:oasis:names:tc:SAML:1.1:nameid-format:unspecifiedhttps://serverfault.com/questions/710655
复制相似问题