Re: how to prevent auth ticket expiration

Tech-Archive recommends: Speed Up your PC by fixing your registry



The event handler goes in global.asax. Modules that fire events can have those events handled in global.asax via ModuleName_EventName syntax. Here's the event decl:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebsecurityformsauthenticationmoduleclassauthenticatetopic.asp?frame=true

-Brock
DevelopMentor
http://staff.develop.com/ballen



I searched the whole MSDN library and there is no OnAuthenticate
event. This is a good idea but how do I override this event and where
is this event?

The closest I could find is "AddOnAuthenticateRequestAsync" but I have
no idea how to implement this. It does not even show in the methods
that can be overriden in the IDE. It passes two delegates and this
async stuff makes me shudder. I could not find any examples of how
this works.

Thanks
Perry
Maybe there is another way to prevent the auth ticket from updating
for a specified page. Can't this process be intercepted and
overriden in some place?

Actually, there is one other idea. The FormsAuthModule fires a
OnAuthenticate event which you can use to specify the user. If you
specify a method:

void FormsAuthentication_Authenticate(object s,
FormsAuthenticationEventArgs e)
{
if (HttpContext.Current.Request.Path == "ThePathIWantToIgnore.aspx")
{
e.User = new GenericPrincipal(new GenericIdentity(string.Empty,
string.Empty), new string[0]);
}
}
If you specify the identity, it won't be read from the forms auth
cookie, and you won't get the extention of the cookie timeout. I
don't know why I didn't think of this earlier.

-Brock
DevelopMentor
http://staff.develop.com/ballen



.



Relevant Pages

  • Re: how to prevent auth ticket expiration
    ... I searched the whole MSDN library and there is no OnAuthenticate event. ... is a good idea but how do I override this event and where is this event? ... > OnAuthenticate event which you can use to specify the user. ... > If you specify the identity, it won't be read from the forms auth cookie, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Overriding "OnXXX" versus adding event handler
    ... to touch base functionality and not to deal with component ... Either for base class or for my class. ... For example, you can either write a new OnPaint override, or you can ... In other words, override when you can, add an event handler if you can't. ...
    (microsoft.public.dotnet.framework)
  • Re: How To Determine What Caused PostBack
    ... One is to use a Server Control for ... > your HTML image input element, and to write a server-side Event Handler ... > to dynamically specify a delegate for an event procedure to handle this ... > control into a hidden form field and submits the form. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: translate VB -> CS
    ... To follow the event handler practise, ... Wire the event handler ... Bit simpler way is to just override Page's OnPreRender method when all the ... but it is then important to remember to call the base class method ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Web Form Designer generated code
    ... The first section is an override of the Page.OnInit method. ... IDE calls the event handler method Page_Load. ... > override protected void OnInit{ ... > InitializeComponent(); ...
    (microsoft.public.dotnet.languages.csharp)