I am facing problems in order to restrict the access to an action in a controller (let's say wwww.mysite.com/callback/c1). I would like that only an external ERP system will be able to access this controller. The ERP allows me to set up a callback URL to which it will make a POST request each time that an specific event occurs in this ERP system.
Now, I don't want anyone else to be able post anything to this URL. How can I protect this url to be accessed only from the ERP system?
I've been thinking about hardcoding a user and password in the ERP URL, so it would make the post request to www.mysite.com/callback/c1?userName=user&password=pass , this way I could check if the credentials are valid and if so proceed the request, but the credentials would be visible in the ERP system.
Is there any other way to achieve this?
PD: I am using ASP .NET MVC5 PD2: I don't have control over the ERP system for modifications, I only can set the callback URL.