I am following this article to authenticate users of a Web API service I'm writing :
http://codebetter.com/johnvpetersen/2012/04/02/making-your-asp-net-web-apis-secure/
This works just fine.
In summary, we use a custom action filter (that gets applied to all requests), that checks an encrypted request header to determine who the user is.
However, I also have code in my controller action methods that needs to know who the current user is. Rather than repeat the logic that has been executed in the ActionFilter, is there a way I can set a variable in the action filter and refer to that in the controller action method?
I have also seen it suggested that MessageHandler should be used rather than an actionFilter. Would that help in some way?
Essentially I need to somehow flag up who the current user is in the Filter code and be able to refer to that in my controller
Or am I way off here? Is ther a smarter way? thanks