Authenticate with netcup server. Must be called first.
356003
def _authenticate(self):
        """"""
        login_info = self._apicall('login')
        self.api_session_id = login_info['apisessionid']
        if not self.api_session_id:
            raise Exception('Login failed')
        # query ttl and verify access to self.domain:
        zone_info = self._apicall('infoDnsZone', domainname=self.domain)
        self.zone_ttl = zone_info['ttl']
900952
def authenticationReject():
    """"""
    a = TpPd(pd=0x5)
    b = MessageType(mesType=0x11)  # 00010001
    packet = a / b
    return packet
374919
def _authenticate(self):
        
        opts = {'domain': self._domain}
        opts.update(self._auth)
        response = self._api.domain.info(opts)
        self._validate_response(
            response=response, message='Failed to authenticate')

        # set to fake id to pass tests, inwx doesn't work on domain id but
        # uses domain names for identification
        self.domain_id = 1

        return True
752036
def authenticate(self):
        """"""
        endpoint = os.path.join(self.config.get('napps', 'api'), 'auth', '')
        username = self.config.get('auth', 'user')
        password = getpass("Enter the password for {}: ".format(username))
        response = requests.get(endpoint, auth=(username, password))
        if response.status_code != 201:
            LOG.error(response.content)
            LOG.error('ERROR: %s: %s', response.status_code, response.reason)
            sys.exit(1)
        else:
            data = response.json()
            KytosConfig().save_token(username, data.get('hash'))
            return data.get('hash')
591052
def authenticate(self, driver):
        """"""
        #                      0                      1                    2                    3
        events = [driver.username_re, driver.password_re, self.device.prompt_re, driver.rommon_re,
                  #       4             5                   6                       7                8
                  driver.unable_to_connect_re, driver.authentication_error_re, pexpect.TIMEOUT, pexpect.EOF]

        transitions = [
            (driver.username_re, [0], 1, partial(a_send_username, self.username), 10),
            (driver.username_re, [1], 1, None, 10),
            (driver.password_re, [0, 1], 2, partial(a_send_password, self._acquire_password()),
             _C['first_prompt_timeout']),
            (driver.username_re, [2], -1, a_authentication_error, 0),
            (driver.password_re, [2], -1, a_authentication_error, 0),
            (driver.authentication_error_re, [1, 2], -1, a_authentication_error, 0),
            (self.device.prompt_re, [0, 1, 2], -1, None, 0),
            (driver.rommon_re, [0], -1, partial(a_send, "\r\n"), 0),
            (pexpect.TIMEOUT, [0], 1, partial(a_send, "\r\n"), 10),
            (pexpect.TIMEOUT, [2], -1, None, 0),
            (pexpect.TIMEOUT, [3, 7], -1, ConnectionTimeoutError("Connection Timeout", self.hostname), 0),
            (driver.unable_to_connect_re, [0, 1, 2], -1, a_unable_to_connect, 0),
        ]
        self.log("EXPECTED_PROMPT={}".format(pattern_to_str(self.device.prompt_re)))
        fsm = FSM("CONSOLE-SERVER-AUTH", self.device, events, transitions, timeout=_C['connect_timeout'],
                  init_pattern=self.last_pattern)
        return fsm.run()
1315183
def authenticate(self):
        """"""
        if self.apiKey:
            return
        loginResponse = self._curl_bitmex(
            api="user/login",
            postdict={'email': self.login, 'password': self.password, 'token': self.otpToken})
        self.token = loginResponse['id']
        self.session.headers.update({'access-token': self.token})
697651
def authenticate(self) -> bool:
        """"""
        with IHCController._mutex:
            if not self.client.authenticate(self._username, self._password):
                return False
            if self._ihcevents:
                self.client.enable_runtime_notifications(
                    self._ihcevents.keys())
            return True
455542
def authenticate(self, api_key):
        """"""
        self._api_key = api_key

        # Attach auth to session.
        self._session.auth = ('', self._api_key)

        return self._verify_api_key()
144792
private boolean authenticate(Session session, String userName, String password, PasswordEncrypter pe)
      throws Exception
   {
      boolean authenticated;

      Node userNode;
      try
      {
         userNode = utils.getUserNode(session, userName);
      }
      catch (PathNotFoundException e)
      {
         return false;
      }
      boolean enabled = userNode.canAddMixin(JCROrganizationServiceImpl.JOS_DISABLED);
      if (!enabled)
      {
         throw new DisabledUserException(userName);
      }

      if (pe == null)
      {
         authenticated = utils.readString(userNode, UserProperties.JOS_PASSWORD).equals(password);
      }
      else
      {
         String encryptedPassword =
            new String(pe.encrypt(utils.readString(userNode, UserProperties.JOS_PASSWORD).getBytes()));
         authenticated = encryptedPassword.equals(password);
      }
      if (authenticated)
      {
         Calendar lastLoginTime = Calendar.getInstance();
         userNode.setProperty(UserProperties.JOS_LAST_LOGIN_TIME, lastLoginTime);
         session.save();
      }
      return authenticated;
   }
1028650
def authenticate(db, user, password):
    
    try:
        logger.debug("Authenticating {} with {}".format(db, user))
        return db.authenticate(user, password)
    except OperationFailure as e:
        logger.debug("Auth Error %s" % e)
    return False
1243386
def _authenticate(self):
        """"""
        if not self._get_provider_option(
                'auth_username') or not self._get_provider_option('auth_password'):
            raise Exception(
                'No valid authentication data passed, expected: auth-username and auth-password')
        response = self._request_login(self._get_provider_option('auth_username'),
                                       self._get_provider_option('auth_password'))
        if 'ssid' in response:
            self.ssid = response['ssid']
            domains = self.domains_list()
            if any((domain['name'] == self.domain for domain in domains)):
                self.domain_id = self.domain
            else:
                raise Exception("Unknown domain {}".format(self.domain))
        else:
            raise Exception("No SSID provided by server")
889478
def authenticated(function):
    """"""
    def wrapped(*args):
        """Wrap function."""
        try:
            return function(*args)
        except UPSError:
            _login(*args)
            return function(*args)
    return wrapped
608893
protected function authenticate()
    {
        if ((!$this->storage->get('access_token'))) {
            try {
                $this->getAccessToken();
            } catch(\Dropbox\Exception $e) {
                $this->getRequestToken();
                $this->authorise();
            }
        }
    }
1136922
def _netapp_login(self):
        

        self.server = NaServer(self.ip, 1, 3)
        self.server.set_transport_type('HTTPS')
        self.server.set_style('LOGIN')
        self.server.set_admin_user(self.netapp_user, self.netapp_password)
1245479
def authenticate(previous_token = None):
    

    # if we already have a session token, try to authenticate with it
    if previous_token != None:
        headers = server_connection.request("authenticate", {
            'session_token' : previous_token,
            'repository'    : config['repository']})[1] # Only care about headers

        if headers['status'] == 'ok':
            return previous_token

    # If the session token has expired, or if we don't have one, re-authenticate

    headers = server_connection.request("begin_auth", {'repository' : config['repository']})[1] # Only care about headers

    if headers['status'] == 'ok':
        signature = base64.b64encode(pysodium.crypto_sign_detached(headers['auth_token'].decode('utf-8'), config['private_key']))
        headers = server_connection.request("authenticate", {
            'auth_token' : headers['auth_token'],
            'signature'  : signature,
            'user'       : config['user'],
            'repository' : config['repository']})[1] # Only care about headers

        if headers['status'] == 'ok': return headers['session_token']
    raise SystemExit('Authentication failed')
698677
def _authenticate(self):
        
        url = "{base_url}/api/authenticate".format(base_url=self._base_url())
        data = json.dumps({'username': self.username, "password": self.password})
        # Bypass authentication check in make_request by using _send_request
        logger.debug("Authenticating against NetMRI")
        self._send_request(url, method="post", data=data)
        self._is_authenticated = True
544502
def authenticate(self):
        
        endpoint = '/authenticate'

        payload = {
            'agent': {
                'name': 'Minecraft',
                'version': self.ygg_version,
            },
            'username': self.username,
            'password': self.password,
            'clientToken': self.client_token,
        }
        rep = self._ygg_req(endpoint, payload)
        if not rep or 'error' in rep:
            return False
        self.access_token = rep['accessToken']
        self.client_token = rep['clientToken']
        self.available_profiles = rep['availableProfiles']
        self.selected_profile = rep['selectedProfile']
        return True