I'm not sure why, but my FederatedAuthentication.SessionAuthenticationModule resolves NULL and my application crashes when I try to run the ClaimsTransformer () module:
public void EstablishSession(ClaimsPrincipal principal) { var sessionToken = new SessionSecurityToken(principal, TimeSpan.FromHours(8)) { IsPersistent = false,
Here is what in my 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.web> <authentication mode="None" /> </system.web> <system.webServer> <modules runAllManagedModulesForAllRequests="true"> <remove name="RoleManager" /> <remove name="FormsAuthentication" /> <remove name="SessionAuthenticationModule" /> <add name="SessionAuthenticationModule" type="System.IdentityModel.Services.SessionAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> </modules> </system.webServer> <system.identityModel> <identityConfiguration> <claimsAuthenticationManager type="Web.Infrastructure.Authentication.ClaimsTransformer, Web" /> </identityConfiguration> </system.identityModel> <system.identityModel.services> <federationConfiguration> <cookieHandler requireSsl="false" /> </federationConfiguration> </system.identityModel.services>
This drives me crazy, because I have the code working in the project (proof of concept) without any problems, and everything appears that I need for this functionality to work, but for some strange reason, when I try to implement our real project, my FederatedAuthentication.SessionAuthenticationModule is always NULL.
What am I missing here? Any ideas? Why is the SessionAuthenticationModule not initializing correctly?
source share