I'm working on a MVC 4 web application, on VS 2010. What I am trying to do is:
- Restrict access to all users unless you are SUPERADMIN automatically (login in using form authentication)
If the action/controller states you that a specific roles can have access then it gives them access. For example:
[AuthorizeFor(Roles = "REVIEWER")] public ActionResult Index() { return View(); }
In the case above, only users with roles SUPERADMIN OR REVIEWER can access this action.
I will also be using WEBAPI so I can push content to third parties, and so should be accessible by anyone, but they will need to authenticate via url paramenter with hmac. For example: http://example.com/api/feed/1?appid=BLAH×tamp=BLAH&hmac=BLAH. In short, the API section of the site should not be using the same authentication as the rest of it.
How would I set this up?
I am building a content management system for internal use here at my job, and the API will supply the data that we enter in to third party websites/vendors.