alanchinese
Regular
- Joined
- Jan 12, 2005
- Messages
- 62
hi, the asp.net server uses active directory for authentication. in iis, the anonymous access is unchecked and windows authentication is check. however, page.user.identity.name returns empty string. what is the cause?
the following code
<code>
Response.Write( "Page.User Identity: [" + Page.User.Identity.Name + "]<br>" );
Response.Write( "Window.Current Identity: [" + System.Security.Principal.WindowsIdentity.GetCurrent().Name + "]<br>" );
Response.Write( "Thread.Current Identity: [" + System.Threading.Thread.CurrentPrincipal.Identity.Name + "]<br>" );
</code>
derives these results:
Page.User Identity: []
Window.Current Identity: [NT AUTHORITY\NETWORK SERVICE]
Thread.Current Identity: []
the following code
<code>
Response.Write( "Page.User Identity: [" + Page.User.Identity.Name + "]<br>" );
Response.Write( "Window.Current Identity: [" + System.Security.Principal.WindowsIdentity.GetCurrent().Name + "]<br>" );
Response.Write( "Thread.Current Identity: [" + System.Threading.Thread.CurrentPrincipal.Identity.Name + "]<br>" );
</code>
derives these results:
Page.User Identity: []
Window.Current Identity: [NT AUTHORITY\NETWORK SERVICE]
Thread.Current Identity: []