WIF- ID1014: The signature is not valid. The data may have been tampered with

前端 未结 4 1233
花落未央
花落未央 2021-02-08 22:40

I\'ve been using WIF to authenticate our new website, the STS is based upon the starter-sts implementation.

To enable this to work correctly on out load balanced environ

相关标签:
4条回答
  • 2021-02-08 23:04

    Did you try setting the loadUserProfile option to true? Does the problem still occur?

    (Select the Application pool in IIS and then click "Advanced Settings" on the right. "Load User Profile" is in the "Process Model" section).

    0 讨论(0)
  • 2021-02-08 23:07

    The browser cookies are encrypted with "old" mechanism - DPAPI. Therefore, when the server tries to decrypt the cookies, it fails - your code use RSA now, not DPAPI.

    As a workaround, clear the browser cache, and the application will start running as expected.

    0 讨论(0)
  • 2021-02-08 23:18

    The intermittent occurrence of your error, combined with the DPAPI exception showing up in your traces suggests to me that you aren't actually overriding the cookie transform, and your service is still using DPAPI.

    This might be a long shot, but in your code snippet I noticed your method override "onServiceConfigurationCreated" starts with a lower case o. Such a typo would indeed prevent you from properly overriding default WIF behavior.

    0 讨论(0)
  • 2021-02-08 23:19

    I changed the implementation to amend the timeout in the ontokencreated method. This prevents the reissue.

    protected override void OnSessionSecurityTokenCreated(Microsoft.IdentityModel.Web.SessionSecurityTokenCreatedEventArgs args)
            {
                args.SessionToken = FederatedAuthentication.SessionAuthenticationModule.CreateSessionSecurityToken(
                    args.SessionToken.ClaimsPrincipal,
                    args.SessionToken.Context,
                    DateTime.UtcNow,
                    DateTime.UtcNow.AddDays(365),
                    true
                    );
                //base.OnSessionSecurityTokenCreated(args);
            }
    
    0 讨论(0)
提交回复
热议问题