howto set login failed page when using windows authentification

  • Thread starter Thread starter Dan
  • Start date Start date
D

Dan

hi ng,

is there a way to set a page the user gets redirected when using windows
authentification (and the user gets authentificated by active directory)
and authorization failed?)
i have tried to set the iis error page and the customerrors at
web.config, none of them worked.
when the user cannot be authenticated (e.g. because password wrong), iis
uses the custom error page i defined for the application. as i wanted to.
but when authorization in web.config doesn't grant access (password ok,
but user denied), the user always get redirected to:

Error message 401.2.: You do not have permission to view this directory
or page using the credentials you supplied. Contact the Web server's
administrator for help.

thanks for your help.
dan
 
You can do this only of you have your own server. I you just happen to upload
this site to a shared hosting provider, you will not have access to IIS.
So, in your web.config file you will need to set the customError element like
so..

<configuration>
<system.web>
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly">
<error statusCode="401.2"
redirect="UnAuthorized.html"/>
</customErrors>
</system.web>
</configuration>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top