We are planning on using ASP.Net MVC3 to create a JSON API. For handling security we will have something like an API key, or possibly the Username/Password and maybe a timestamp.
I haven’t done any MVC before but I’m wondering if there isn’t some simple way to add code to Global.asax that ensures that ALL requests have these variables in them somehow. That way, no request could even get through unless it included the API key.
That way we don’t have to add API key handling to each section of the site.
We are planning on using ASP.Net MVC3 to create a JSON API. For handling
Share
Create a global authorization filter –
then register it in Global.asax –
Although you could create a bespoke Authentication module –
Then you just need to register the module in web.config
and set asp.net authentication to none –
Then you can check to see it the user is authenticated in your AuthorizationFilter.