Link to home
Create AccountLog in
Avatar of BWA IT
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
ASKER CERTIFIED SOLUTION
Avatar of Meir Rivkin
Meir Rivkin
Flag of Israel image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of BWA IT
BWA IT

ASKER

I do have 'Integrated Windows Authentication' ticked 'Integrated Windows authentiation is the only slected check box in 'Anonymous access and authentication control'. I can't find any other menu option that refers to Integrated security
Is integrated security disabled in the users browser?