alanchinese Posted July 28, 2008 Posted July 28, 2008 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: [] Quote
Administrators PlausiblyDamp Posted July 28, 2008 Administrators Posted July 28, 2008 Have you set any authorisation rules for the web site under the web.config? If not asp.net will allow any user in regardless of the iis settings. Under the web.config there are two relevant sections - Authorisation and Authentication, as a minimum try setting them to [highlight=xml] [/highlight] these instruct asp.net to use windows authentication and the deny users="?" prevents anonymous access. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.