Invoke an action that is using ASP.NET MVC [Authorize] from outside the application
- by Nate Bross
Is this possible?
I'd like to expose a URL (action) such as http://mysever/myapp/UpdateHeartbeat/.
In my MVC application it looks like
[Authorize]
[AcceptsVerbs(HttpVerbs.Post)]
public ActionResult UpdateHeartbeat()
{
// update date in DB to DateTime.Now
}
Now, in my MVC application the user has logged in via FORMS authentication and they can execute that action to their hearts content.
What I want to do, is hit that URL progromatically (as part of an API that I wouldl like to build) -- is there a way I can do that without removing the [Authorize] attribute and adding username/password as parameters to the POST?