def _AppScaleAuthenticate(self):
    """ Attempts to authenticate user with AppScale's AppServer.  
      If successful, saves authentication information to the cookies 
      directory which is mapped to HttpRpcServer.APPSCALE_COOKIE_DIR.
    """

    if not self.read_credentials:
      credentials = self.auth_function()
      self.username = credentials[0]
      self.password = credentials[1]
      self.read_credentials = True

    curl_command = "curl -k "
    curl_command += "-c %s " % self._GetAppScaleCookiePath()
    curl_command += "--data-urlencode user_email='%s' " % self.username
    curl_command += "--data-urlencode user_password='%s' " % self.password
    curl_command += "--data-urlencode commit=login "
    curl_command += "-X POST "
    curl_command += "%s" % self._GetAppScaleDashboardAuthUrl()

    _, _ = self._RunCommand(curl_command)

    self._LoadAppScaleCookie()
    self.cookie_jar.load()
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/tools/appengine_rpc.py/AbstractRpcServer._AppScaleAuthenticate/original