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. Advertising

  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. Advertising

  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. 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. vsssandeep boggavarapu via .NET 247

    Customizing the Data Grid Control

    vsssandeep boggavarapu via .NET 247, Jun 7, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    589
    Alvin Bruney [MVP - ASP.NET]
    Jun 11, 2005
  2. Mithun Verma

    Customizing crystal reports through code

    Mithun Verma, Jul 1, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    350
    Mithun Verma
    Jul 1, 2003
  3. John Knoop

    Customizing XML from DataSet

    John Knoop, Oct 22, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    346
    John Knoop
    Oct 22, 2003
  4. Replies:
    0
    Views:
    381
  5. Ram...

    Customizing windows authentication

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

Share This Page