Problem authenticating using Windows

V

vvenk

Hello:

I wanted to implement windows-based authentication.

However when I run this aspx form, I do not see the user name and
Authentication type.

Can somebody tell me what I am doing wrong? Here's the code snippets:

WindowsAuth.ASPX
<html>

<script language="VB" runat=server>

Sub Page_Load(Src As Object, E As EventArgs)
AuthUser.Text = User.Identity.Name
AuthType.Text = User.Identity.AuthenticationType
End Sub

</script>

<body>

<h3><font face="Verdana">Using Windows Authentication</font></h3>

<table Width="700" rules="all" bordercolor="Black"
style="background-color:#ccccff;bordercolor:black;font-family:Verdana;font-size:8pt;border-collapse:collapse;">
<tr>
<td>User:</td>
<td><asp:label id=AuthUser runat=server/>
</tr>
<tr>
<td>Authentication Type:</td>
<td><asp:label id=AuthType runat=server/>
</tr>
</table>

</body>

</html>

Web.config
<configuration>
<system.web>
<authentication mode="Windows" />
<globalization requestEncoding="UTF-8" responseEncoding="UTF-8" />
</system.web>
</configuration>

Thanks.

Venki
 
B

Bob Barrows [MVP]

vvenk said:
Hello:

I wanted to implement windows-based authentication.

However when I run this aspx form,

There was no way for you to know it, but this is a classic asp newsgroup.
While you may be lucky enough to find a dotnet-knowledgeable person here who
can answer your question, you can eliminate the luck factor by posting your
question to a group where those dotnet-knowledgeable people hang out. I
suggest microsoft.public.dotnet.framework.aspnet.

However, read on:
I do not see the user name and
Authentication type.

Can somebody tell me what I am doing wrong? Here's the code snippets:

WindowsAuth.ASPX
<html>

<script language="VB" runat=server>

Sub Page_Load(Src As Object, E As EventArgs)
AuthUser.Text = User.Identity.Name
AuthType.Text = User.Identity.AuthenticationType
End Sub
You must turn off "Anonymous Access" in IIS manager in order for IIS to pass
the Windows credentials to your code.

If that's not the problem, follow up in the aspnet group.

Bob Barrows
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top