我在Windows Server 2008上使用IIS 7.5託管我的Web應用程序, 我有2個Web應用程序: 1.第一個是核心sso(Single Sign-on)服務與登錄頁面。 2.另一個Web應用程序託管在使用第一個應用程序的同一個Web服務器上。WIF RTM發生奇怪的錯誤,在復位後發生IIS
我使用WIF RTM來實現SSO,
通常,這是沒有任何問題運行良好,用戶可以登錄扔SSO和重定向回起始頁。 但是當我首先登錄扔SSO,然後重新啓動IIS,如果我回來的第二個應用程序,並刷新頁面,我得到了以下錯誤:
Server Error in '/' Application. Key not valid for use in specified state. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Security.Cryptography.CryptographicException: Key not valid for use in specified state.
Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[CryptographicException: Key not valid for use in specified state. ]
System.Security.Cryptography.ProtectedData.Unprotect(Byte[] encryptedData, Byte[] optionalEntropy, DataProtectionScope scope) +425
Microsoft.IdentityModel.Web.ProtectedDataCookieTransform.Decode(Byte[] encoded) +59[InvalidOperationException: ID1073: A CryptographicException occurred when attempting to decrypt 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.Decode(Byte[] encoded) +151
Microsoft.IdentityModel.Tokens.SessionSecurityTokenHandler.ApplyTransforms(Byte[] cookie, Boolean outbound) +109
Microsoft.IdentityModel.Tokens.SessionSecurityTokenHandler.ReadToken(XmlReader reader, SecurityTokenResolver tokenResolver) +634
Microsoft.IdentityModel.Tokens.SessionSecurityTokenHandler.ReadToken(Byte[] token, SecurityTokenResolver tokenResolver) +105
Microsoft.IdentityModel.Web.SessionAuthenticationModule.ReadSessionTokenFromCookie(Byte[] sessionCookie) +239
Microsoft.IdentityModel.Web.SessionAuthenticationModule.TryReadSessionTokenFromCookie(SessionSecurityToken& sessionToken) +59
Microsoft.IdentityModel.Web.SessionAuthenticationModule.OnAuthenticateRequest(Object sender, EventArgs eventArgs) +52
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75________________________________________ Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927
用戶會話中使用SQLServer的會話存儲模式,我正在使用一個特殊的數據庫。
我已經嘗試了很多,我無法在本地計算機(Windows7)上重新處理此問題。 有沒有人有類似的經歷?你能告訴我如何解決這個問題嗎?
我沒有驗證這是否會解決這個問題,因爲這已經很長一段時間了,我不在該項目中,任何人都遇到了這個問題,請添加您的評論。謝謝! – 2012-09-06 05:24:13