FederationAuthenticationModule在运

FederationAuthenticationModule在运

本文介绍了FederatedAuthentication.WSFederationAuthenticationModule在运行时为空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想subcribe为 RedirectingToIdentityProvider 事件的Application_Start(),但FederatedAuthentication.WSFederationAuthenticationModule为空

code

 保护无效的Application_Start()
{
 FederatedAuthentication.WSFederationAuthenticationModule.RedirectingToIdentityProvider + = WSFederationAuthenticationModule_RedirectingToIdentityProvider;
}


解决方案

尝试这样做 - 为我工作。

 无效的Application_Start()
{
    FederatedAuthentication.ServiceConfigurationCreated + = OnServiceConfigurationCreated;
}
无效OnServiceConfigurationCreated(对象发件人,ServiceConfigurationCreatedEventArgs E)
{
    FederatedAuthentication.WSFederationAuthenticationModule.RedirectingToIdentityProvider + = WSFederationAuthenticationModule_RedirectingToIdentityProvider;
}

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;
}
解决方案

Try doing this - works for me.

void Application_Start()
{
    FederatedAuthentication.ServiceConfigurationCreated += OnServiceConfigurationCreated;
}


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

这篇关于FederatedAuthentication.WSFederationAuthenticationModule在运行时为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 09:20