Hi created a web service (.asmx) with form based authentication. Code mentioned below. Can I test this service via Postman.
Below is my code.
public class service1 : System.Web.Services.WebService
{
private string AuthenticateUser(string strUser, string strPassword)
{
return "Dummy";
}
[WebMethod]
public bool Login(string strUser, string strPassword)
{
string strRole = AuthenticateUser(strUser, strPassword);
if (strRole != null)
{
FormsAuthentication.SetAuthCookie(strUser, false);
return true;
}
else
return false;
}
[WebMethod]
public void LogOut()
{
FormsAuthentication.SignOut();
}
[WebMethod]
public string GetMethod()
{
string s = "Authenticated";
return s;
}
}
Below is my web.config settings.
<authentication mode="Forms">
<forms name="MyAuthCookie" loginUrl="service1.asmx" protection="All" timeout="60" path="/"></forms>
</authentication>
<authorization>
<deny users="?" />
</authorization>