4

Maybe this is an ASP.NET beginner's question, but I could not find the answer on this site. I could get a ADF Claimstore object working only in the HttpApplication.PreRequestHandlerExecute event.

In which HttpApplication events is the ADF claimstore expected to be available?

1 Answer 1

9

It is not documented in which Web Application Event ADF should be executed. The recommendation would be to use an event that is executed before the Request Handler is executed and after the session data and cookies are available since they are mandatory for ADF. HttpApplication.PreRequestHandlerExecute is the right event for this.

Please note that ADF is executed as a Http Module that implements IRequiresSessionState and populates claims on PreRequestHandlerExecute

Sample Code:

public class HttpModule : IHttpModule, IRequiresSessionState {
    public void Init(HttpApplication application)
        {
            application.PreRequestHandlerExecute += new EventHandler(this.OnPreRequestHandlerExecute);
        }
}

I hope this helps.

1
  • You are not saying it explictly but I think this means there are no other HttpApplication events cause they are either to early or to late in the chain.
    – Jan H
    Apr 2, 2014 at 7:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.