I have controller
public class BilingController : Controller
{
…
[HttpPost]
public string Result (string data)
{
…
}
…
}
Method Result can be caused only by foreign service process.anypayservice.com
How can I check url, is request from service process.anypayservice.com or other service?
Or allow only this url – process.payservice.com for method Result call
Any attribute or I should write custom?
You can check the
HTTP_REFERERheader, but note that it can be easily spoofed.A better approach is to use some sort of token that can be passed in to your service for authentication.