Author: guyinkalamazoo | Posted on: 11/17/2009 6:06:16 PM | Views : 431

I have a site that uses Windows authentication and the default.aspx page is properly displaying the logged-in user.  When they click a link to go to another page with a web application; the user is NT AUTHORITY\NETWORK SERVICE.  I have the following code to get the user name from a class, but why would this account keep coming up? Public Function getUser() As String
        Dim wpMain As WindowsPrincipal = New WindowsPrincipal(WindowsIdentity.GetCurrent())
        Dim userName As String = wpMain.Identity.Name
        Return userName
    End Function
The page that does come up is using a database connection.  Could this be why?  If so, I need the current logged in user's credentials.
Thanks
< ...

Go to the complete details ...