I need to implement ASP.NET Web API 2 i.e.
[RoutePrefix("orders")]
public class OrdersController : ApiController
{
[Route("{id}")]
public Order Get(int id) { }
[Route("{id}/approve")]
public Order Approve(int id) { }
}
I am wondering how it can be protected?
Can we use ASP.NET Identity for that, for instance?
Any clue?
You could add the [Authorize]
attribute to the class and then send the basic authentication information via the header.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With