Customizing windows authentication

Discussion in 'ASP .Net' started by Ram..., Jan 30, 2007.

  1. Ram...

    Ram... Guest

    Hi,

    In windows authentication
    1. Apart from user name and password, can we force the user to select
    the domain name at the time of login through browser?.

    2. In windows authentication
    If user login fails, how to redirect the user to a customized error
    page?
     
    Ram..., Jan 30, 2007
    #1
    1. Advertisements

  2. 1) No. In Windows Authentication, the browser automatically transmits the
    credentials the user supplied when they logged into their machine. You either
    get authenticated or you don't.
    2) Look into the Custom Error Pages with web.config. I have never done it,
    but you could probably provide a page for the Windows Auth Unauthorized error.
    Peter

    --
    Site: http://www.eggheadcafe.com
    UnBlog: http://petesbloggerama.blogspot.com
    Short urls & more: http://ittyurl.net




    "Ram..." wrote:

    > Hi,
    >
    > In windows authentication
    > 1. Apart from user name and password, can we force the user to select
    > the domain name at the time of login through browser?.
    >
    > 2. In windows authentication
    > If user login fails, how to redirect the user to a customized error
    > page?
    >
    >
     
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=, Jan 30, 2007
    #2
    1. Advertisements

  3. On Jan 30, 1:11 pm, Peter Bromberg [C# MVP]
    <> wrote:
    > 1) No. In Windows Authentication, the browser automatically transmits the
    > credentials the user supplied when they logged into their machine. You either
    > get authenticated or you don't.
    > 2) Look into the Custom Error Pages with web.config. I have never done it,
    > but you could probably provide a page for the Windows Auth Unauthorized error.
    > Peter
    >


    Peter, that is right, however you can tell to client browser, that

    Response.StatusCode=401

    and ask for login and password again.

    To redirect an unauthorized request you can do following coding in
    your global.asax

    Sub Application_EndRequest(ByVal sender As Object, ByVal e As
    EventArgs)
    If Response.StatusCode = 401 Then
    Response.ClearContent()
    Response.WriteFile("/401.html")
    End If
    End Sub
     
    Alexey Smirnov, Jan 30, 2007
    #3
    1. Advertisements

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. Mark
    Replies:
    0
    Views:
    864
  2. Will
    Replies:
    5
    Views:
    3,004
  3. Replies:
    0
    Views:
    458
  4. Dadi
    Replies:
    2
    Views:
    305
    Scott Scott
    Sep 16, 2003
  5. Fabio Gouw

    ASP.NET Authentication and Windows Authentication

    Fabio Gouw, Nov 15, 2004, in forum: ASP .Net Security
    Replies:
    2
    Views:
    264
    Ken Schaefer
    Nov 16, 2004
  6. jfer
    Replies:
    3
    Views:
    740
    Dominick Baier [DevelopMentor]
    Sep 16, 2005
  7. nenzax
    Replies:
    1
    Views:
    328
    Dominick Baier [DevelopMentor]
    Dec 18, 2005
  8. Ram...

    Customizing windows authentication

    Ram..., Jan 30, 2007, in forum: ASP .Net Security
    Replies:
    0
    Views:
    192
    Ram...
    Jan 30, 2007
Loading...