Created
July 19, 2012 22:55
-
-
Save sandrinodimattia/3147435 to your computer and use it in GitHub Desktop.
FederatedAuthentication
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; | |
} | |
private void OnServiceConfigurationCreated(object sender, ServiceConfigurationCreatedEventArgs e) | |
{ | |
var sessionTransforms = new List<CookieTransform>(new CookieTransform[] | |
{ | |
new DeflateCookieTransform(), | |
new RsaEncryptionCookieTransform(e.ServiceConfiguration.ServiceCertificate), | |
new RsaSignatureCookieTransform(e.ServiceConfiguration.ServiceCertificate) | |
}); | |
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