Search code examples
c#asp.net-mvcwif

WIF: SessionAuthenticationModule Always Null


I'm trying to get WIF set up on an MVC project I'm working on but to no avail. The issue I'm having is that FederatedAuthentication.SessionAuthenticationModule is always null. I have added the following lines to web.config under 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" />

I also attempted to init the module:

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

Still nothing. I installed WIF through nuget. I noticed that the namespace for WIF for most of the docs online (like what I posted above) is System.IdentityModel whereas the namespace for the what I have through nuget is Microsoft.IdentityModel. Could this be causing the trouble?

A few specs:

Standard MVC 4 Project

Using Microsoft.IdentityModel.dll v3.5.0.0


Solution

  • System.identitymodel.xxx is the .Net 4.5 version if WIF where everything is merged into the core framework.

    Microsoft.identitymodel.xxx is the .net 4 version that is installed separately.