I am trying to build an application on our company's intranet using ASP.NET and VB.NET.
Neither of these functions return anything once my application is published to IIS. They work fine in development (ie: pressing F5 I get my regular network username), but once published they return '' (an empty string).
HttpContext.Current.User.Identity.Name
Page.User.Identity.Name
I'm looking for something -- anything -- that will grab the current users login name. Please note that I CANNOT change these settings in my web.config, because of other functionality requirements.
<authentication mode="Windows"/>
<roleManager enabled="true" cacheRolesInCookie="true" defaultProvider="AspNetWindowsTokenRoleProvider" cookieName=".ASPXROLES" cookiePath="/" cookieTimeout="480" cookieRequireSSL="false" cookieSlidingExpiration="true" createPersistentCookie="false" cookieProtection="All" />
Nor can I change any IIS settings, to include the 'Enable Anonymous User' setting. Specs are cast in stone and I'd have to chop off my own leg (or head) to get them changed.
I would think there's got to be a way to get the current logged in user's name with my current configuration.
Any ideas?
Thanks,
Jason