public static void ConfigureMackineKeyProtectionForSessionTokens()
 {
     var handler = (SessionSecurityTokenHandler)FederatedAuthentication.FederationConfiguration.IdentityConfiguration.SecurityTokenHandlers[typeof(SessionSecurityToken)];
     if (!(handler is MachineKeySessionSecurityTokenHandler))
     {
         var mkssth = new MachineKeySessionSecurityTokenHandler();
         if (handler != null) mkssth.TokenLifetime = handler.TokenLifetime;
         FederatedAuthentication.FederationConfiguration.IdentityConfiguration.SecurityTokenHandlers.AddOrReplace(mkssth);
     }
 }
Esempio n. 2
0
        public static void ConfigureMackineKeyProtectionForSessionTokens()
        {
            var handler = (SessionSecurityTokenHandler)FederatedAuthentication.FederationConfiguration.IdentityConfiguration.SecurityTokenHandlers[typeof(SessionSecurityToken)];

            if (!(handler is MachineKeySessionSecurityTokenHandler))
            {
                var mkssth = new MachineKeySessionSecurityTokenHandler();
                if (handler != null)
                {
                    mkssth.TokenLifetime = handler.TokenLifetime;
                }
                FederatedAuthentication.FederationConfiguration.IdentityConfiguration.SecurityTokenHandlers.AddOrReplace(mkssth);
            }
        }