Customizing windows authentication

  • Thread starter Thread starter Ram...
  • Start date Start date
R

Ram...

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?
 
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
 
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
 
Back
Top