Created
June 21, 2012 19:28
-
-
Save woloski/2967962 to your computer and use it in GitHub Desktop.
WIF disabling encryption and signature on cookies
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void Application_Start() | |
{ | |
FederatedAuthentication.ServiceConfigurationCreated += OnServiceConfigurationCreated; | |
} | |
void OnServiceConfigurationCreated(object sender, | |
ServiceConfigurationCreatedEventArgs e) | |
{ | |
List<CookieTransform> sessionTransforms = | |
new List<CookieTransform>( | |
new CookieTransform[] | |
{ | |
new DeflateCookieTransform(), | |
//new RsaEncryptionCookieTransform("some x509 cert with private key"), | |
//new RsaSignatureCookieTransform("some x509 cert with private key") | |
} | |
); | |
var sessionHandler = new SessionSecurityTokenHandler(sessionTransforms.AsReadOnly()); | |
e.ServiceConfiguration.SecurityTokenHandlers.AddOrReplace(sessionHandler); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment