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.