首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >WIF: SessionAuthenticationModule总是零

WIF: SessionAuthenticationModule总是零
EN

Stack Overflow用户
提问于 2013-09-29 07:43:05
回答 2查看 556关注 0票数 0

我正在尝试让WIF建立在我正在开发的MVC项目上,但没有结果。我遇到的问题是FederatedAuthentication.SessionAuthenticationModule总是空的。我在web.config中添加了以下configSections

代码语言:javascript
复制
<section name="system.identityModel"
    type="System.IdentityModel.Configuration.SystemIdentityModelSection, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<section name="system.identityModel.services"
    type="System.IdentityModel.Services.Configuration.SystemIdentityModelServicesSection, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />

我还试图插入该模块:

代码语言:javascript
复制
<modules>
  <add name="SessionAuthenticationModule"
       type="System.IdentityModel.Services.SessionAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
       preCondition="managedHandler" />
</modules>

还是一无所获。我通过nuget安装了WIF。我注意到大多数在线文档的WIF名称空间(就像我上面发布的一样)是System.IdentityModel,而我通过nuget拥有的名称空间是Microsoft.IdentityModel。这会引起麻烦吗?

一些规格:

标准MVC 4项目

使用Microsoft.IdentityModel.dll v3.5.0.0

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2013-09-29 09:46:57

System.identitymodel.xxx是.Net 4.5版本的if,其中所有内容都合并到核心框架中。

Microsoft.identitymodel.xxx是单独安装的.net 4版本。

票数 0
EN

Stack Overflow用户

发布于 2015-04-28 05:48:28

您不需要安装WIF 4与nuget。.Net框架4.5内置了对这个库的支持。您的web.config必须是这样的:

代码语言:javascript
复制
    <configSections>
<section name="system.identityModel" type="System.IdentityModel.Configuration.SystemIdentityModelSection, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<section name="system.identityModel.services" type="System.IdentityModel.Services.Configuration.SystemIdentityModelServicesSection, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</configSections>

以及:

代码语言:javascript
复制
<system.webServer>
<modules>
  <add name="WSFederationAuthenticationModule" type="System.IdentityModel.Services.WSFederationAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
  <add name="SessionAuthenticationModule" type="System.IdentityModel.Services.SessionAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
</modules>
</system.webServer>
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19075656

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档