我试图在Application_Start()中订阅RedirectingToIdentityProvider事件,但是FederatedAuthentication.WSFederationAuthenticationModule为null
码
protected void Application_Start()
{
FederatedAuthentication.WSFederationAuthenticationModule.RedirectingToIdentityProvider += WSFederationAuthenticationModule_RedirectingToIdentityProvider;
}
Run Code Online (Sandbox Code Playgroud)
小智 5
尝试这样做 - 适合我.
void Application_Start()
{
FederatedAuthentication.ServiceConfigurationCreated += OnServiceConfigurationCreated;
}
void OnServiceConfigurationCreated(object sender, ServiceConfigurationCreatedEventArgs e)
{
FederatedAuthentication.WSFederationAuthenticationModule.RedirectingToIdentityProvider += WSFederationAuthenticationModule_RedirectingToIdentityProvider;
}
Run Code Online (Sandbox Code Playgroud)
听起来您WSFederationAuthenticationModule的配置中可能缺少 。确保你有这个system.webServer\modules:
<add name="WSFederationAuthenticationModule" type="Microsoft.IdentityModel.Web.WSFederationAuthenticationModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler" />
Run Code Online (Sandbox Code Playgroud)
这在system.web\httpModules:
<add name="WSFederationAuthenticationModule" type="Microsoft.IdentityModel.Web.WSFederationAuthenticationModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
Run Code Online (Sandbox Code Playgroud)
阅读此处了解更多信息。
| 归档时间: |
|
| 查看次数: |
7183 次 |
| 最近记录: |