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
Post a Comment