Integrated Authentication Global.asax

G

Guest

I need to update a sql table with the last date/time that a user logged into
my web site. The site is protected via integrated authentication. I can put
code in the global.asax file to update when a user hits any page in the site.
Is there any code I can put in to capture if a user tries to access a .PDF
file in the web site ? For example the user can open a broswer and request
http:\\mywebsite\application1\test.pdf. This action does not appear to fire
off any events in the global.asax that is in directory
\\mywebsite\application1.

Any help would be appreciated. thanks
 
G

Guest

Basically what I need is an event fired when someone requests a .pdf file on
my web server.
 
S

Scott Allen

Yes, you can route requests for the .PDF file extension thorugh the
ASP.NET runtime. This would allow you to examine the request in the
events of the HttpApplication in global.asax.

This KB article will tell you how to edit the script mappings to route
ther file extensionsf through the asp.net pipeline:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;815152

It goes on to show how to deny access to the new file types, which is
not what you want to do, but it does have all the other instructions
you need.

HTH,
 
G

Guest

Thanks for the reply. That's exactly what I was looking for. 1 more question:
I am using basic authentication on my site, which always prompts the user
for id/pwd when the site is first accessed. Is there an event in the
global.asax that will fire after the user provides his/her credentials ? I
don't want an event that will fire for every request.
 
S

Scott Allen

Hi Jzink:

No, there is no direct event that will fire at that point. The server
doesn't really know when the browser is prompting the user, it only
knows if a request has credentials associated with it or not.
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top