BWA IT
asked on
How to get the windows AD user name in asp.net
Hi, I want to display the windows Active directory username of whoever is running my asp.net website. In web.config i have <authentication mode="Windows"/>.
In IIS i have unchecked the anonymous access check box and Integrated Windows authentiation is the only slected check box in 'Anonymous access and authentication control'.
My vb.net is simply on page load:
Dim windowslogin As String = Page.User.Identity.Name
Label1.Text = windowslogin
When I run the website through visual studio the label populates correctly with the username. However when I run the website deployed on my web server the label is empty.
Could you suggest where I might be going wrong?
Thanks
In IIS i have unchecked the anonymous access check box and Integrated Windows authentiation is the only slected check box in 'Anonymous access and authentication control'.
My vb.net is simply on page load:
Dim windowslogin As String = Page.User.Identity.Name
Label1.Text = windowslogin
When I run the website through visual studio the label populates correctly with the username. However when I run the website deployed on my web server the label is empty.
Could you suggest where I might be going wrong?
Thanks
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Is integrated security disabled in the users browser?
ASKER