我們使用在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