473,770 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

howto set login failed page when using windows authentificatio n

Dan
hi ng,

is there a way to set a page the user gets redirected when using windows
authentificatio n (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
Nov 18 '05 #1
2 3209
You can set this page in IIS directory Properties > Custom Errors and
select the respective error number and set the custom page for that.

Enjoy
Sudhakar Sadasivuni
http://weblogs.asp.net/ssadasivuni
MyUG : http://www.mugh.net
"Dan" wrote:
hi ng,

is there a way to set a page the user gets redirected when using windows
authentificatio n (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

Nov 18 '05 #2
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..

<configuratio n>
<system.web>
<customErrors defaultRedirect ="GenericError. htm"
mode="RemoteOnl y">
<error statusCode="401 .2"
redirect="UnAut horized.html"/>
</customErrors>
</system.web>
</configuration>

"Sudhakar Sadasivuni[mvp]" wrote:
You can set this page in IIS directory Properties > Custom Errors and
select the respective error number and set the custom page for that.

Enjoy
Sudhakar Sadasivuni
http://weblogs.asp.net/ssadasivuni
MyUG : http://www.mugh.net
"Dan" wrote:
hi ng,

is there a way to set a page the user gets redirected when using windows
authentificatio n (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

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1731
by: Jonas S. | last post by:
Hi all, I need some simple component (COM+ or just DLL) source to perform Basic Authentification for ASP solution. Short explanation what I mean: In non secure area I've a form with fields Login name and password. After pressing submit button that component has to redirect to page in secure area (https://) and perform NT Basic authentification [ or redirect to another page saying about failing). .. That has to be replacement of that...
3
3481
by: Mike Hutton | last post by:
Hi, I have tried to keep things simple. Not simple enough, obviously. I have a set of intranet ASP.NET pages which access a SQL back-end through the normal SQLConnection stuff. I want to use peoples' NT logons to user-stamp data changes made through the web-pages. So it seemed obvious to use Windows authentication to access SQL connections.
4
7227
by: rrober07 | last post by:
Hello, My Setup is I have a Web Server machine(Devweb01), Database SQL Machine(Devsql01), a Client Machine(local machine) I have configured the SQL machine as follows: 1) Added local Aspnet user account (with same password as aspnet user on IIS (Devweb01)) 2) edited local machine.config file <ProcessModel> Password attribute to same password (both on IIS and SQL Machine) 3) SQL Server security is Sql Server and Windows
0
1261
by: Dan | last post by:
hi ng, is there a way to set a custom login failed page when using windows authentification? my settings are: --------------------- <authorization> <allow users="x,y,z" /> <deny users="*" /> ---------------------
10
4517
by: et | last post by:
I have an asp.net program that uses a connection string, using integrated security to connect to a sql database. It runs fine on one server, but the other server gives me the error that "Login failed for user "NT AUTHORITY/ANONYMOUS LOGON". Why would this be? There is no reason it should even be trying to login to using NT Authority/Anonymous login. The IIS Server is set to turn off anonymous logins, and use integrated security, and my...
1
2795
by: sefe dery | last post by:
Hi ng, i have an Asp.net webapplication on a remote Windows Server 2003. I created on the remote server a windows account and i use the "only windows authentification" in sql server 2000. The name and passwort for the windows account are the same like the credentials in asp.net.
5
2303
by: Ramtin | last post by:
Hi; when I use sql server connection or ole connection for working with database I receive the login failed for user 'any user that I work'.I've been granted ASPNET user in sql.
0
1298
by: Jean | last post by:
Hi, I have a question about logins and sql server express and an ASP.NET aplication. I put this question in sql server newsgroup, but without real answer sofar. I created a login 'Network service' at server level in Management Studio express. I use windows authentification. Then i defined an user for my database which is associated to login 'Network
4
3789
by: Brett | last post by:
I have an ASP.NET 2.0 application that uses Forms Authentication. The startup page contains just a login control, and the site works well on an IIS 6 web server. I am now setting the site up on the production web server, which runs Windows 2008 Server and IIS 7. The login page comes up, but when I try to log in, I get the error, "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection." For debugging...
0
9617
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10257
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9904
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.