title: MVC sign out of claims identity authentication
body: <p>Moving away from Forms Authentication and trying to get my head around Claims Identity users can successfully login using this</p>
  
  <pre><code>Dim vIdentity As New ClaimsIdentity({New Claim(ClaimTypes.Name, Session("UserName"))}, DefaultAuthenticationTypes.ApplicationCookie, ClaimTypes.Name, ClaimTypes.Role)
                  vIdentity.AddClaim(New Claim(ClaimTypes.Role, "User"))
                  Authentication.SignIn(New AuthenticationProperties With {.IsPersistent = False}, vIdentity)
  </code></pre>
  
  <p>But having problems with the logout - I thought AuthenticationManager.Signout() would work but I get 'Signout is not a member of AuthenticationManager' so now a little stumped.</p>
  
  <p>This is in Global</p>
  
  <pre><code>System.Web.Helpers.AntiForgeryConfig.UniqueClaimTypeIdentifier = System.Security.Claims.ClaimTypes.Name
  </code></pre>
  
  <p>I tried this in the logout controller </p>
  
  <pre><code>Function Index() As ActionResult
          If User.Identity.IsAuthenticated Then
              Dim vUser = TryCast(User, ClaimsPrincipal)
              Dim vIdentity = TryCast(User.Identity, ClaimsIdentity)
              Dim vClaim = (From c In vUser.Claims Where c.Value = Session("UserName") Select c).Single()
              vIdentity.RemoveClaim(vClaim)
          End If
          Return View()
      End Function
  </code></pre>
  
  <p>But that returned the error</p>
  
  <pre><code>A claim of type 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name' was not present on the provided ClaimsIdentity. 
  </code></pre>
  
  <p>when it hit </p>
  
  <pre><code>@Html.AntiForgeryToken()
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>Thanks</p>