I have two asp.net mvc web applications; one is an ERP system for managing our assets and the other is a scanning service that offers services to scan servers and vms and update the ERP database with the scan result
Now for example inside the scanning service I have the following action method, which can be called by passing a security token & the server name we want to scan:-
public async Task<ActionResult> ScanServer(string tokenfrom, string FQDN) //only the ERP system should be able to call this
{
string Token = System.Web.Configuration.WebConfigurationManager.AppSettings["Token"];//get the token from the web.config, this should be encrypted
if (tokenfrom != Token ) // check if the request is authorized by checking comparing the 2 tokens.
{
return new HttpStatusCodeResult(403, "request failed");
}
And the above action ...
Go to the complete details ...