Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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: []

  • Administrators
Posted

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.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...