我正在使用WIF 4.0来构建声明感知的RP和STS。 我现在遇到问题,因为我已经用承载应用程序的多台服务器部署到了生产环境。 由于某种原因,我感到恐惧
[CryptographicException: Key not valid for use in specified state. ]
用户闲置一段时间后出现错误。 我想知道是否有人对此有经验? 使用机器钥匙会有所帮助吗? 在服务器上重置IIS时,我也看到此错误。 我已经将LoadUserProfile设置为true。
我认为您需要在web.config中指定与此类似的内容。 此外,您需要在所有服务器上将机器密钥设置为相同。
<system.identityModel>
<identityConfiguration>
<securityTokenHandlers>
<remove type="System.IdentityModel.Tokens.SessionSecurityTokenHandler, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add type="System.IdentityModel.Services.Tokens.MachineKeySessionSecurityTokenHandler, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</securityTokenHandlers>
</identityConfiguration>
</system.identityModel>