After some research I finally found an answer that solved my problem. I removed the anonymous access in IIS and in web.config added the following:
Code:
<authentication mode="Windows"/>
<identity impersonate="true"/>
<authorization>
<allow users ="krypton\zuperman" />
<deny users ="*" />
</ authorization>
I tested using the following code:
Code:
Imports System.Security
Protected Sub Page_Load (ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
As String Dim authUserName
As String Dim aspUserName
authUserName = User.Identity.Name
aspUserName = Principal.WindowsIdentity.GetCurrent.Name
authUserPrincipalLabel.Text = "You are" & authUserName
aspPrincipalLabel.Text = "This page runs as:" & aspUserName
End Sub
Both labels returns the current user...
When I try to enter a user that is not set to access in the web.config, IIS shows the access denied error ... exactly how it should do.
I hope I have solved my problem, however, like to keep the topic open to see if I can get other opinions...
Thx