I have created a generic handler inside an entity framework application that displays data from a table. I want to secure the handler in case anyone tries to access it directly with the url or otherwise. Where and how do I write the username and password that authenticates before processing and bringing up the data when this is called from another application (the calling application will have the username and pwd)
public class MyDatahandler: IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.Response.Clear();
context.Response.ContentType = "text/plain";
Mydatalogic a = new dataLogic;
a.DisplayView();
}
}
The calling request is using request.Credentials = new NetworkCredential(userName, password); where have mutual agreement of what username and password to use. Where will I map these in my handler?