title: ZAP Authentication using API calls
body: <p>I am using ZAP API calls to test a site using command line. But I have a problem with the user authentication even though I am following the correct steps. But I still can't manage to pass the login page when spider as a user. Below are the steps that I am follwing.</p>
  
  <p>1.Include in the context (context/includeContext)</p>
  
  <p>2.Change Authentication Method to formBased. (authentication/setAutenticationMethod)
      Here I only pass contextID,authMethodName and in authMethodConfigParams only the logiunUrl. Not the loginrequestData. I tried to pass authMethodConfigParams as</p>
  
  <p><code>loginUrl=**********************&amp;loginRequestData=username={%username%}&amp;password={%password%}</code></p>
  
  <p>but the field doen't fills up when I use this.</p>
  
  <p>3.Set the login Indicator (authentication/setLoggedInIndicator)</p>
  
  <p>4.Enable auto Reauthentication (auth/autoReauthON)</p>
  
  <p>5.Add a new user (users/nweUser)</p>
  
  <p>6.Set credentials for user ( users/setAuthenticationCredentials)</p>
  
  <p>7.Enable user (users/setUserEnabled)</p>
  
  <p>8.Spider as the new user (spider/scanAsUser)</p>
  
  <p>But in spidering it cannot get pass the log in page. When I Open the UI application all the API calls have been worked and all the settings 
  have been configured on the session properties. But when I check the POST request it is as below.</p>
  
  <pre><code>username=ZAP&amp;password=ZAP&amp;rememberMe=true
  </code></pre>
  
  <p>I think this is the problem. Why doesn't it take the new users credentials??</p>
  
  <p>Thanks in advance</p>