Hi
We are using passive claims based authentication on a load balanced app with sticky sessions enabled. We want to get rid of sticky sessions and to do this As suggested by some article on msdn site, I added this piece of code to my global.asax file to change the encryption from DPAPI to RSA.
void FederatedAuthentication_ServiceConfigurationCreated(object sender,Microsoft.IdentityModel.Web.Configuration.ServiceConfigurationCreatedEventArgs e)
{ Log.Debug("FederatedAuthentication_ServiceConfigurationCreated"); List<CookieTransform> sessionTransforms = new List<CookieTransform>(new CookieTransform[] { new DeflateCookieTransform(), new RsaEncryptionCookieTransform(e.ServiceConfiguration.ServiceCertificate), new RsaSignatureCookieTransform(e.ServiceConfiguration.ServiceCertificate) }); SessionSecurityTokenHandler sessionHandler = new SessionSecurityTokenHandler(sessionTransforms.AsReadOnly()); e.ServiceConfiguration.SecurityTokenHandlers.AddOrReplace(sessionHandler); Microsoft.IdentityModel.Web.FederatedAuthentication.WSFederationAuthenticationModule.AuthorizationFailed += WSFederationAuthenticationModule_AuthorizationFailed; }
After adding this code, I receive the below error:
Server Error in '/' Application.
Value cannot be null.
Parameter name: certificate
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: certificate
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
Stack Trace:
|
Did anyone else experience this error and found a solution? if so please guide me.
RKD
RKD