title: Retrieving a users password in Cloud Code
body: <p>Is it possible to retrieve a users password in Cloud Code by using <code>myUser.get("password")</code>? I'm even using the master key and I still can't retrieve it.</p>
  
  <hr>
  
  <p><strong>Update:</strong></p>
  
  <pre><code> PFCloud.callFunctionInBackground("updateUser", withParameters: ["username" : username, "newPassword" : newPasswordText.text, "currentPassword" : currentPasswordText.text, "operation" : 2]) {
              (positions: AnyObject!, error: NSError!) -&gt; Void in
              if error == nil {
  
                      self.navigationController?.popToRootViewControllerAnimated(true)
              }
  
              else {
  
                  let errorAlert = UIAlertController (title: "Error", message: "Invalid current password", preferredStyle: UIAlertControllerStyle.Alert)
  
                  let actionCancel = UIAlertAction (title: "Dismiss", style: .Cancel, handler: nil)
  
                  errorAlert.addAction(actionCancel)
  
                  self.presentViewController(errorAlert, animated: true, completion: nil)
  
              }
          }
  </code></pre>
  
  <hr>
  
  <pre><code>Parse.Cloud.define("updateUser", function(request, response) {
  // Set up to modify user data
  Parse.Cloud.useMasterKey();
  var query = new Parse.Query(Parse.User);
  query.equalTo("username", request.params.username);
  query.first({
  
          success: function(myUser) {
  
        var password = myUser.get("password");
  
          if (request.params.operation == 1) {
  
              myUser.set("password", request.params.newPassword);
  
          }
  
          else if (request.params.operation == 2 &amp;&amp; password == request.params.currentPassword) { 
  
            myUser.set("password", request.params.newPassword);
  
          }
  
          else {
  
              response.error(password);
          }
  
              myUser.save(null, {
  
                  success: function(myUser) {
                      // The user was saved successfully.
                      response.success("Successfully updated user.");
                  },
  
                  error: function(myUser, error) {
                      // The save failed.
                      // error is a Parse.Error with an error code and description.
                      response.error("Could not save changes to user.");
                  }
              });
  
      },
  
      error: function(error) {
              alert("Error: " + error.code + " " + error.message);
      }
  });
  });
  </code></pre>