我们使用在IIS 6 SessionAuthenticationModule一个问题,尝试访问该应用程序时,以下异常occures:问题使用WIF与IIS6
数据保护操作不成功。这可能是因为没有为当前线程的用户上下文加载用户配置文件,这可能是线程模拟时的情况。
我已经能够解决的是有可能在IIS 7中启用配置文件,但我们的托管公司使用IIS 6. 任何想法该怎么办?要尝试的东西,还是只是一般的想法?
堆栈跟踪:
[CryptographicException: The data protection operation was unsuccessful. This may have been caused by not having the user profile loaded for the current thread's user context, which may be the case when the thread is impersonating.]
System.Security.Cryptography.ProtectedData.Protect(Byte[] userData, Byte[] optionalEntropy, DataProtectionScope scope) +456
Microsoft.IdentityModel.Web.ProtectedDataCookieTransform.Encode(Byte[] value) +54
[InvalidOperationException: ID1074: A CryptographicException occurred when attempting to encrypt the cookie using the ProtectedData API (see inner exception for details). If you are using IIS 7.5, this could be due to the loadUserProfile setting on the Application Pool being set to false. ]
Microsoft.IdentityModel.Web.ProtectedDataCookieTransform.Encode(Byte[] value) +146
Microsoft.IdentityModel.Tokens.SessionSecurityTokenHandler.ApplyTransforms(Byte[] cookie, Boolean outbound) +47
Microsoft.IdentityModel.Tokens.SessionSecurityTokenHandler.WriteToken(XmlWriter writer, SecurityToken token) +470
Microsoft.IdentityModel.Tokens.SessionSecurityTokenHandler.WriteToken(SessionSecurityToken sessionToken) +89
Microsoft.IdentityModel.Web.SessionAuthenticationModule.WriteSessionTokenToCookie(SessionSecurityToken sessionToken) +123
谢谢,会检查是否有可能。实际上我们结束了,因为我的应用程序由外部提供者托管,实现了使用机器密钥的替代令牌处理程序(因此不需要“用户配置文件”)。这不是最佳的解决方案,但作为一个暂时的解决方案。 – Kristoffer 2010-10-27 07:04:46