I do not have any experience in working in asmx. The company I work in is trying to update their time entry site. It was built in using web service asmx and anyone with the url could access the time entry for it. Now they want to implement a basic authentication feature for it so anyone can't access it. After searching and trying out approaches of different blogs and stackoverflow questions I am now stuck and don't know how to approach the problem and don't understand the underlying principle in how the asmx service can perform basic authentication.
I tried this approach,
public class WebServiceAuthentication : AuthorizedWebService
{
[WebMethod]
[SoapHeader("Authentication", Direction = SoapHeaderDirection.In)]
public string HelloWorld()
{
base.Authorize();
return "Hello " + base.Authentication.Username;
//return "Hello";
}
}
Where authorizedWebService calling a database and authenticating username and password.