title: httpContext User Identity
body: <p>I would like to restrict user's access on my website based on the the User Identity and I used following code its works fine in Visual Studio but when I am publishing into IIS sending <strong>userIdentity= NULL</strong> to Database. </p>
  
  <pre><code>Dim httpContext__1 As HttpContext = HttpContext.Current
  Dim winIdentity As System.Security.Principal.WindowsIdentity = DirectCast(httpContext__1.User.Identity, WindowsIdentity)
  Dim userIdentity As String = winIdentity.Name
  
  hasAccess = GetUserFromDB(userIdentity)
  If hasAccess Then
      ' restrictions on 
  Else
  End If
  </code></pre>