I am trying to subcribe to RedirectingToIdentityProvider event in Application_Start() , but FederatedAuthentication.WSFederationAuthenticationModule is null
code
protected void Application_Start()
{
FederatedAuthentication.WSFederationAuthenticationModule.RedirectingToIdentityProvider += WSFederationAuthenticationModule_RedirectingToIdentityProvider;
}
Make sure in your Global.asax you referencing the
and not:
The wrong (inconsistent between web.config and global.asax) reference will cause the WSFederationAuthenticationModule be null.
Try doing this - works for me.
It sounds like you may be missing the
WSFederationAuthenticationModule
in your configuration. Make sure you have this insystem.webServer\modules
:And this in
system.web\httpModules
:Read here for more information.
Here is a precision for .net 4.0