HttpContext.Current.User.Identity.Name returns wrong user name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

We have an active directory user that just had her username renamed.
When the user is running an application that calls our CurrentUser web
service method (which returns the value of
HttpContext.Current.User.Identity.Name), her old username is returned.
DOMAIN\oldusername instead of DOMAIN\newusername. The user is logged in with
this new username and when we make a windows client .NET call to
System.Security.Principal.WindowsIdentity.GetCurrent.Name it returns the
correct username "DOMAIN\newusername".

This has stumped the developers and our network admins. Can anyone point us
in the right direction or do we have to call Microsoft? It has not resolved
itself in 4 days now.

Hopefully someone will be so kind to share some information if they have it.

<WebMethod()> _
Public Function CurrentUser() As String
'Returns current user identity
Return HttpContext.Current.User.Identity.Name
End Function
 
This is likely your problem:
http://support.microsoft.com/kb/946358

The LsaLookupSids function is likely returning the old usernam because the LsaLookupCache is stale.

Either a reboot, or setting the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\LsaLookupCacheMaxSize to DWORD 0 will fix your problem.
 
Last edited:
Back
Top