473,395 Members | 1,766 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,395 software developers and data experts.

determining if a user is authenticated

How does one determine from Global.Application_BeginRequest() -- where
no Session information is available -- whether the invoking user has
been authenticated?
Nov 21 '05 #1
2 1994
The application events occur in this sequence: BeginRequest,
AuthenticateRequest, AuthorizeRequest. Therefore you can determine if the
user was authenticated only starting at the AuthenticateRequest event
handling, e.g.

Sub Application_AuthenticateRequest(ByVal sender As Object, ByVal e As
EventArgs)
Dim app As HttpApplication = CType(sender, HttpApplication)
If app.Context.User.Identity.IsAuthenticated Then
'do something
End If
End Sub
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Robert Rotstein" wrote:
How does one determine from Global.Application_BeginRequest() -- where
no Session information is available -- whether the invoking user has
been authenticated?

Nov 21 '05 #2
You don't. There no access to Session from
that event, as you have already found out.

SessionState is not loaded until after the BeginRequest
has fired and before the EndRequest has fired.

Specifically, Session is accessible after AcquireRequestState has fired :

http://msdn.microsoft.com/library/de...statetopic.asp

You might want to use any event which fires after AcquireRequestState
has fired, like HttpApplication.PreRequestHandlerExecute :

http://msdn.microsoft.com/library/de...statetopic.asp

You could also use the PreSendRequestContent event :
http://msdn.microsoft.com/library/de...ntentTopic.asp

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Robert Rotstein" <rr*******@verizon.net> wrote in message
news:fwcgf.1303$%%5.1302@trndny06...
How does one determine from Global.Application_BeginRequest() -- where no Session
information is available -- whether the invoking user has been authenticated?

Nov 21 '05 #3

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

Similar topics

0
by: Haim Ashkenazi | last post by:
Hi A client of mine wants me to write a simple web interface for qmail's autorespond. this means that a user must authenticate with his system user/password, and then make some changes to the...
3
by: Jiho Han | last post by:
Should ASPNET user belong to the local Users group? I may have made some changes that affected my workstation setup and I am experiencing some unexpected behaviors. For example, I have my IIS...
4
by: Brian Lowe | last post by:
I'm using Forms authentication with my user data in a SQL db. I have pages in the main appliaction folder accessible to anonymous users and I've set security to deny annonymous users access to...
4
by: Jamie Pollard | last post by:
hello, i have been scouring the groups for the best possible solution to this problem, but can't seem to find my exact scenario, so hopefully someone can get me back on the right path. my...
4
by: Steven Caliendo | last post by:
Hi, In my web app I need to know who is currently logged on to the PC. Can someone tell me how to do this ? Thanks, Steve
5
by: Shimon Sim | last post by:
I am working with LogIn control and need to set some property for profile after user is authenticated. I thought that LoggedIn event is the right place but system tells me that the property can't...
3
by: shapper | last post by:
Hello, I need to check if a user is authenticated. I tried everything I could think and find: If Membership.ValidateUser("shapper", "27lamps11") Then...
1
by: chad.poplawski | last post by:
Hi All, I'm working on a Windows Service that uses FileSystemWatcher components to capture and log data when certain actions (such as files being deleted) take place in the file system. I am...
4
by: subaloka | last post by:
is there some possible code which one can use to determine the distance of the person fom the screen
0
by: =?Utf-8?B?UmFtb24gR2VuZQ==?= | last post by:
What's the best way in .Net (C#) to verify if an specific user has write access to a folder? Any code snippet is appreciated. Thanks a lot, Ramon
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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:
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...

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.