Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Problem authenticating using Windows

Reply
Thread Tools

Problem authenticating using Windows

 
 
vvenk
Guest
Posts: n/a
 
      09-26-2005
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
 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      09-26-2005
vvenk wrote:
> 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
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Authenticating windows user Mike P ASP .Net 1 06-06-2007 11:10 AM
Authenticating LDAP connection with current windows user's credentials? bugnthecode Java 5 02-08-2007 05:44 AM
Authenticating users against Windows NT User GROUPS Jr. BTS dev! ASP .Net 2 01-27-2006 02:55 AM
Windows authentication not authenticating Jason ASP .Net 3 10-14-2004 08:39 PM
How do you figure out the LDAP://? ("Error authenticating. Error authenticating user. The specified domain either does not exist or could not be contacted") mrwoopey ASP .Net 3 06-30-2003 10:11 PM



Advertisments