title: Checkmarx issue: The application stores sensitive personal data Write on the client, in an insecure manner
body: <p>CheckMarx report throws <code>The application stores sensitive personal data Write on the client, in an insecure manner</code> </p>
  
  <p>Code</p>
  
  <pre><code>var httpWebRequest = (HttpWebRequest)WebRequest.Create(requestUrl);
  httpWebRequest.Headers.Clear();
  httpWebRequest.ContentType = "application/json";    // set the conetnt type as application/json
  httpWebRequest.Method = "POST";  // make the post request
  //create the auth tocken on base of user id
  // and add the auth tocken to the http web request.
  httpWebRequest.Headers.Add("Authorization", CreateToken(userid));  
  
  using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
  {
      // make the idm request
      var request = new RequestClass{uid = userid, pwd = password, appKey = "XX1"};
      //serialize the request object
      char[] arayChar = JsonConvert.SerializeObject(request).ToCharArray();
      SecureString json = new SecureString();
  
      foreach (var item in arayChar)
      {
          json.AppendChar(item);
      }
      // write the serialized json over request stream
      // and flush the stream.
      var result = SecureStringToString(json);
  
      streamWriter.Write(result); 
      streamWriter.Flush();
      streamWriter.Close();
  }
  </code></pre>
  
  <p>I am getting this error on <code>streamWriter.Write(result);</code>.</p>
  
  <p>Error message is: <code>The application stores sensitive personal data Write on the client, in an insecure manner.</code></p>