Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > determining if a user is authenticated

Reply
Thread Tools

determining if a user is authenticated

 
 
Robert Rotstein
Guest
Posts: n/a
 
      11-21-2005
How does one determine from Global.Application_BeginRequest() -- where
no Session information is available -- whether the invoking user has
been authenticated?
 
Reply With Quote
 
 
 
 
=?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
Guest
Posts: n/a
 
      11-21-2005
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?
>

 
Reply With Quote
 
 
 
 
Juan T. Llibre
Guest
Posts: n/a
 
      11-21-2005
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" <(E-Mail Removed)> 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?



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
In Enterprise Library, Where to invoked the store procedure "GetPassword" to authenticated the user? Benny Ng ASP .Net 0 09-19-2005 01:30 PM
ASP.NET Forms Authentication - How to Know if User Has Previously Been Authenticated David Krussow ASP .Net 2 01-17-2005 05:19 PM
Launch a specific msi installer based on an authenticated user Olivier Verdin ASP .Net 0 11-05-2004 07:10 AM
Prevent a page in an authenticated application from being authenticated Abhijit ASP General 0 04-12-2004 02:10 PM
Terminating a authenticated user Kristofer Liljeblad ASP .Net 3 06-30-2003 01:32 PM



Advertisments