will IIS keep track of the parameters sent to a post action method

56 Views Asked by At

I have the following Post action method which accept username & password, connect to Active Directory and get the user info in JSON format after validating the credentials:

[HttpPost]
public ActionResult UserInfo(string username, string password)
{

now since this is a POSt action method, will IIS logs keep track of the entered parameters? in this case the username and password? If the answer is yes, then how i can secure those parameters? Thanks

1

There are 1 best solutions below

3
Jason Pan On

The params in your code snippet can be found in IIS logs.

If you want to protect the params, you should use something like below.

[HttpPost("Post")]
public string bb([FromForm]string name)
{
    return name;
}

When you are using something like [FromForm], not params. Then the data will hide in http post request.