Implement security Token caching in MachineKeySessionSecurityTokenHandler


Implement security Token caching in MachineKeySessionSecurityTokenHandler



I need to implement SessionSecurityTokenCache in MachineKeySessionSecurityTokenHandler in order to be able to configure SecurityTokenHandlers in WsFederationAuthenticationOptions in a load-balanced web farm.



I implemented following code however it is not working:


var options = new WsFederationAuthenticationOptions();
var machineKeyHandler = new MachineKeySessionSecurityTokenHandler();
machineKeyHandler.Configuration = new SecurityTokenHandlerConfiguration();
machineKeyHandler.Configuration.Caches.SessionSecurityTokenCache = new CustomerSessionSecurityTokenCache();
options.SecurityTokenHandlers.Add(machineKeyHandler);



Could anyone suggest is this correct approach or anything else need to be done.









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Comments

Popular posts from this blog

paramiko-expect timeout is happening after executing the command

Possible Unhandled Promise Rejection (id: 0): ReferenceError: user is not defined ReferenceError: user is not defined

Opening a url is failing in Swift