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

标签 asp.net wif

我正在尝试订阅 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 - FederatedAuthentication.WSFederationAuthenticationModule 在运行时为 null,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8937123/

相关文章:

asp.net - ASP .NET 到 MySQL : Are persistent connections possible? 如何?

c# - 具有多个 STS 的 WIF

asp.net - 如何跟踪过期的 WIF fedauth cookie?

c#-4.0 - WIF 4.5 声明值 - 未将对象引用设置为对象的实例

asp.net - 服务器事件后禁用和启用 jquery 中的按钮

asp.net - 隐藏所有重定向信息

c# - 无法从动态创建控件中读取值

ASP.NET C# - 使用用户控件的下拉列表

.net - 联合安全 - 单独的 SSL 和 RP 证书(.NET 4.5 和 WIF)

SAML token 大小和 REST