title: WIF's SessionAuthenticationModule is always null. Why?
body: <p>I have the following on my project:</p>
  
  <pre><code>ClaimsIdentity identity = new ClaimsIdentity(claims, "Forms");
  ClaimsPrincipal principal = new ClaimsPrincipal(identity);
  principal = FederatedAuthentication.FederationConfiguration.IdentityConfiguration.ClaimsAuthenticationManager.Authenticate(String.Empty, principal);
  
  SessionAuthenticationModule module = FederatedAuthentication.SessionAuthenticationModule;
  
  SessionSecurityToken token = new SessionSecurityToken(principal, new TimeSpan(24, 0, 0));
  token.IsPersistent = FederatedAuthentication.FederationConfiguration.WsFederationConfiguration.PersistentCookiesOnPassiveRedirects;
  token.IsReferenceMode = module.IsReferenceMode;
  
  module.WriteSessionTokenToCookie(token);
  </code></pre>
  
  <p>And the configuration I am using is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
    &lt;configuration&gt;
      &lt;configSections&gt;
        &lt;section name="system.identityModel" type="System.IdentityModel.Configuration.SystemIdentityModelSection, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /&gt;
        &lt;section name="system.identityModel.services" type="System.IdentityModel.Services.Configuration.SystemIdentityModelServicesSection, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /&gt;
      &lt;/configSections&gt;
    &lt;system.web&gt;
      &lt;authentication mode="Forms" /&gt;
    &lt;/system.web&gt;
    &lt;system.webServer&gt;
      &lt;modules runAllManagedModulesForAllRequests="true"&gt;
        &lt;add name="SessionAuthenticationModule" type="System.IdentityModel.Services.SessionAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler" /&gt;      
      &lt;/modules&gt;
    &lt;/system.webServer&gt;
    &lt;system.identityModel.services&gt;
      &lt;federationConfiguration&gt;
        &lt;cookieHandler requireSsl="false" name="federation" /&gt;
      &lt;/federationConfiguration&gt;
    &lt;/system.identityModel.services&gt;
  </code></pre>
  
  <p>My current questions are:</p>
  
  <ol>
  <li><p>Do I need the token.IsPersistent? 
  Since it is using ...WsFederationConfiguration?
  I am not sure if I should keep this or from where should I take the value.</p></li>
  <li><p>Why is my module null when I use Visual Studio Development Server and not null when I use the Local IIS Web Server? I would like to work fine in both.</p></li>
  <li><p>Should I use  or </p></li>
  <li><p>Do I need to turn off the Role, Membership, ... providers? 
  Since I am not using them ... If yes why?</p></li>
  </ol>