Skip to content

Instantly share code, notes, and snippets.

@tugberkugurlu
Created July 4, 2012 09:02
Show Gist options
  • Save tugberkugurlu/3046216 to your computer and use it in GitHub Desktop.
Save tugberkugurlu/3046216 to your computer and use it in GitHub Desktop.
public class Global : System.Web.HttpApplication {
protected void Application_Start(object sender, EventArgs e) {
GlobalHost.Something.Add(new TheThingsThatRunsOnEverRequestBeforeHubs());
}
}
//Just like Web API message handlers
public class TheThingThatRunsOnEverRequestBeforeHubs : Something {
public Task Execute(SomeSortofRequestContext context) {
//I would like to do something here as in Web API message handlers
//For example, I want to see if the user has the right auth credintials or not.
//if so, I would like to populate the CurrentPrincipal.
//if not, I would like to send back an unauth response
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment