0

作業中の MVC プロジェクトで WIF をセットアップしようとしていますが、役に立ちません。私が抱えている問題は、それFederatedAuthentication.SessionAuthenticationModuleが常にnullであることです。の下の web.config に次の行を追加しました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" />

モジュールの初期化も試みました。

<modules>
  <add name="SessionAuthenticationModule"
       type="System.IdentityModel.Services.SessionAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
       preCondition="managedHandler" />
</modules>

まだ何もありません。ナゲット経由でWIFをインストールしました。オンラインのほとんどのドキュメント (上記で投稿したものなど) の WIF の名前空間は でSystem.IdentityModelあるのに対し、nuget を介して持っているものの名​​前空間はMicrosoft.IdentityModel. これが問題を引き起こしている可能性がありますか?

いくつかの仕様:

標準 MVC 4 プロジェクト

Microsoft.IdentityModel.dllv3.5.0.0 の使用

4

2 に答える 2

1

nuget を使用して WIF 4 をインストールする必要はありません。.Net Framework 4.5 には、このライブラリのサポートが組み込まれています。web.config は次のようにする必要があります。

    <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>

と:

<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>
于 2015-04-28T05:48:28.630 に答える
0

System.identitymodel.xxx は、すべてがコア フレームワークにマージされる WIF の場合、.Net 4.5 バージョンです。

Microsoft.identitymodel.xxx は、個別にインストールされる .net 4 バージョンです。

于 2013-09-29T09:46:57.440 に答える