asp.net – FederatedAuthentication.WSFederationAuthenticationModule在运行时为null

前端之家收集整理的这篇文章主要介绍了asp.net – FederatedAuthentication.WSFederationAuthenticationModule在运行时为null前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我试图在Application_Start()中订阅RedirectingToIdentityProvider事件,但是FederatedAuthentication.WSFederationAuthenticationModule为null

protected void Application_Start()
{
 FederatedAuthentication.WSFederationAuthenticationModule.RedirectingToIdentityProvider += WSFederationAuthenticationModule_RedirectingToIdentityProvider;
}

解决方法

尝试这样做 – 适合我.
void Application_Start()
{
    FederatedAuthentication.ServiceConfigurationCreated += OnServiceConfigurationCreated;
}


void OnServiceConfigurationCreated(object sender,ServiceConfigurationCreatedEventArgs e)
{
    FederatedAuthentication.WSFederationAuthenticationModule.RedirectingToIdentityProvider += WSFederationAuthenticationModule_RedirectingToIdentityProvider;
}

猜你在找的asp.Net相关文章