473,414 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

ASP.NET and custom ISAPI filter authentication

We have an existing ISAPI filter that performs authentication for all pages
on our web site, including pages we are now writing for ASP.NET. The filter
is pretty basic, receiving the user name and password in clear text and
checking them against a database of users. The filter has been in use for
some time with classic ASP pages.

From classic ASP pages, the application can retrieve the login name that the
user entered from Request.ServerVariables("AUTH_USER"), which I assume
simply parses the http Authorization header. The account used by the
authentication filter for impersonation can be retreived using
Request.ServerVariables("LOGON_USER").

The problem we are running into with ASP.NET is that no matter what
authentication mode we set in the Web.Config file (Windows or None), we are
having problems accessing the login name entered by the user.
Request.ServerVariables("AUTH_USER") will always return blank, and
IIdentity.Name will either be blank or will contain the name of the
impersonation account.

We were planning on writing our own implementation of the IPrincipal and
IIdentity interfaces so that we can set the IIdentity.Name property
correctly, but I am trying to figure which authorization mode is correct and
how we should extract the login name entered by the user. I would prefer to
not parse the http headers in our code just to extract the login name, but I
can't find any other way to do it.

Any suggestions?

TIA

MJS
Nov 17 '05 #1
1 7213
I have the exact same problem and I am considering what to do.
I don't have a clean solution, but as a workaround I am thinking of doing something like this:

1. In Global.asax in Session_Start check Session for some value like say "REAL_USER_NAME"

2. If it is not there then do a redirect to a *.asp page that will pick up AUTH_USER server variable (that does actuall have the value I want since it is a normal ASP page and not ASP.NET)

3. Pass the value you got in the *.asp page to an *.aspx page in the query string and that *.aspx page can put it in the Session object

4. Redirect from the *.aspx page above to the page that originally started the mess.

This will create an overhead at the session start and does not look very elegant.
Hope somebody has a better idea.

We have an existing ISAPI filter that performs authentication for all pages
on our web site, including pages we are now writing for ASP.NET. The filter
is pretty basic, receiving the user name and password in clear text and
checking them against a database of users. The filter has been in use for
some time with classic ASP pages.

From classic ASP pages, the application can retrieve the login name that the
user entered from Request.ServerVariables("AUTH_USER"), which I assume
simply parses the http Authorization header. The account used by the
authentication filter for impersonation can be retreived using
Request.ServerVariables("LOGON_USER").

The problem we are running into with ASP.NET is that no matter what
authentication mode we set in the Web.Config file (Windows or None), we are
having problems accessing the login name entered by the user.
Request.ServerVariables("AUTH_USER") will always return blank, and
IIdentity.Name will either be blank or will contain the name of the
impersonation account.

We were planning on writing our own implementation of the IPrincipal and
IIdentity interfaces so that we can set the IIdentity.Name property
correctly, but I am trying to figure which authorization mode is correct and
how we should extract the login name entered by the user. I would prefer to
not parse the http headers in our code just to extract the login name, but I
can't find any other way to do it.

Any suggestions?

TIA

MJS
Mar 24 '06 #2

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

Similar topics

1
by: Aaron | last post by:
whats the difference between an isapi filter and isapi extension? thanks
0
by: Cybermedia Marketing | last post by:
I'm trying to convert an ISAPI filter to an httpmodule. The ISAPI filter added custom headers to the response which could later be accessed by the asp page. ISAPI Filter: ...
2
by: Boris Condarco | last post by:
Hi gurus, I was reading some documentation about security in .NET Framework, it mention that it is possible to make custom Role Based security for example: check the authentication with Windows...
2
by: Jon Maz | last post by:
Hi All, I've been looking into options for URL Rewriting in .net, and to be honest, I haven't seen anything that's easier than the old Classic Asp solution with an ISAPI filter redirecting to an...
13
by: Patrick.O.Ige | last post by:
How can i get to redirect users if the get error 401.2 to another page? I guess i should be possible to do it in Global.asax? Or are there any better ways around it.. Any better solutions in...
7
by: Adam | last post by:
Im trying to add an httphandler for all *.sgf file extensions. I have developed the handler, 1. installed it into the gac 2. added it to the machine.config: <httpHandlers> <add verb="*"...
2
by: Drew Burchett | last post by:
I am currently coding an ISAPI filter and I would like to use some .Net functionality within the filter. However, when I include calls to anything in the framework, it locks the dll and will not...
2
by: Sheila | last post by:
Hi, I have setup a Sharepoint 2003 server which has an ISAPi filter installed, now I want to develop a HTTPModule which needs to run before the ISAPI filter. So my question is, if a HTTPModule...
0
by: Chris Curvey | last post by:
Hi all, I'm trying to write an ISAPI filter in Python, using the examples that come in the "isapi" directory of the win32com package. The installation program itself runs fine, but when I...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.