Authentication name blank

Disco_gal_1

Newcomer
Joined
Oct 1, 2004
Messages
10
Hello -

I am using the User.Identity.Name to get the user that is logged into the pc. When I debug or run my ASP.Net application through Visual Studio this works as expected when I build an executable and install it on my pc it returns a blank value.

Any suggestions?

Thanks in advance!

Keri
 
Hi Keri,
I had similar problems, have you checked your web.config file. If this is not setup to allow authentication, you will not be able to pass the cookie in the session state, and this is where the user.identity.name gets its information from.

Have a look and if this is not the case, get back to me and I will try and help you some more

Ash
 
Yes, my authentication is set to

<authentication mode="Windows"/>

<authorization>
<allow users="*" /> <!-- Allow all users -->

</authorization>

Unless there is something else I need in web.config.

Thanks for your input!

Keri
 
I have found the problem....

Even though I turned off the Anonymous Access in the properties of the application before I did my build, when I install the application the anonymous access box is checked again. The anonymous access is found on the Directory Security tab of the application properties. I am not sure how this gets turned back on but it breaks my authentication code.

Keri
 
Back
Top