Problem authenticating using Windows

Discussion in 'ASP General' started by vvenk, Sep 26, 2005.

  1. vvenk

    vvenk Guest

    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
     
    vvenk, Sep 26, 2005
    #1
    1. Advertising

  2. 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"
     
    Bob Barrows [MVP], Sep 26, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mrwoopey
    Replies:
    3
    Views:
    9,628
    mrwoopey
    Jun 30, 2003
  2. Jason
    Replies:
    3
    Views:
    581
    Jason
    Oct 14, 2004
  3. Jr. BTS dev!
    Replies:
    2
    Views:
    1,647
    =?Utf-8?B?Q2hhc2U=?=
    Jan 27, 2006
  4. bugnthecode
    Replies:
    5
    Views:
    4,146
    Brandon McCombs
    Feb 8, 2007
  5. Mike P

    Authenticating windows user

    Mike P, Jun 6, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    282
    Kevin Spencer
    Jun 6, 2007
Loading...

Share This Page