Fetches credentials.

@return array
559681
private function fetchCredentials()
    {
        $backoff = new ExponentialBackoff($this->retries, $this->getRetryFunction());

        try {
            return $backoff->execute(
                [$this->getCredentialsFetcher(), 'fetchAuthToken'],
                [$this->authHttpHandler]
            );
        } catch (\Exception $ex) {
            throw $this->convertToGoogleException($ex);
        }
    }
794902
public function getCredentials()
    {
        $auth = $this->request->getHeader('Authorization');

        if (!$auth) {
            return null;
        }

        if ('basic ' !== strtolower(substr($auth, 0, 6))) {
            return null;
        }

        $credentials = explode(':', base64_decode(substr($auth, 6)), 2);

        if (2 !== count($credentials)) {
            return null;
        }

        return $credentials;
    }
378445
protected function getCredentials(Request $request)
    {
        $credentials = $request->only($this->loginUsername(), 'password');
        
        return array_merge($credentials, ['site_id' => site()->getCurrent()->id]);
    }
1368355
public function getTemporaryCredentials()
    {
        $uri = $this->urlTemporaryCredentials();

        $client = $this->createHttpClient();

        $header = $this->temporaryCredentialsProtocolHeader($uri);
        $authorizationHeader = array('Authorization' => $header);
        $headers = $this->buildHttpClientHeaders($authorizationHeader);

        try {
            $response = $client->post($uri, [
                'headers' => $headers,
            ]);
        } catch (BadResponseException $e) {
            return $this->handleTemporaryCredentialsBadResponse($e);
        }

        return $this->createTemporaryCredentials((string) $response->getBody());
    }
901680
def fetch_credentials(auth_id, auth_token):
    """"""

    if not (auth_id and auth_token):
        try:
            auth_id = os.environ['PLIVO_AUTH_ID']
            auth_token = os.environ['PLIVO_AUTH_TOKEN']
        except KeyError:
            raise AuthenticationError('The Plivo Python SDK '
                                      'could not find your auth credentials.')

    if not (is_valid_mainaccount(auth_id) or is_valid_subaccount(auth_id)):
        raise AuthenticationError('Invalid auth_id supplied: %s' % auth_id)

    return AuthenticationCredentials(auth_id=auth_id, auth_token=auth_token)
73910
protected function getTokenCredentials() {
        return [
            'server' => $this->settings->getServiceEndpoint( 'sts' ),
            'endpoint' => $this->settings->getAuthenticationEndpoint(),
            'username' => $this->settings->username,
            'password' => $this->settings->password,
        ];
    }
947808
public function retrieveByCredentials(array $credentials)
    {
        $criteria = [];
        foreach ($credentials as $key => $value) {
            if (!Str::contains($key, 'password')) {
                $criteria[$key] = $value;
            }
        }

        return $this->getRepository()->findOneBy($criteria);
    }
1352138
public function fetchData() {
        /* If using PHP in CGI mode and non standard environment */
        if (isset($_SERVER[$this->options["environment"]])) {
            $message = "Using token from environent";
            $header = $_SERVER[$this->options["environment"]];
        } else {
            $message = "Using token from request header";
            $header = $this->app->request->headers("Authorization");
        }

        $matches = null;

        if (preg_match("/Bearer\s+(.*)$/i", $header, $matches)) {
            $this->log(LogLevel::DEBUG, $message);
            return array(self::KEY_TOKEN => $matches[1]);
        }

        /* Bearer not found, try a cookie. */
        if ($this->app->getCookie($this->options["cookie"])) {
            $this->log(LogLevel::DEBUG, "Using token from cookie");
            $token = $this->app->getCookie($this->options["cookie"]);
            return array(self::KEY_TOKEN => $token);
        }

        /* If everything fails log and return false. */
        $message = "Token not found";

        $this->error = new \SlimPower\Authentication\Error();
        $this->error->setDescription($message);

        $this->log(LogLevel::WARNING, $message);
        return false;
    }
469879
protected function getRepositoryCredentials()
    {
        $config = (array) $this->config->getContextually('vcs');
        $credentials = (array) $this->localStorage->get('credentials');

        return array_merge($config, $credentials);
    }
218177
public function createCredentials()
    {
        $credentials = new Credentials();
        $credentials->setTransactor($this);
        $credentials->setCredentials(array(
            'providerId' => null,
            'providerGateId' => null,
            'providerGateKey' => null,
            'merchantId' => null,
            'merchantGateId' => null,
            'merchantGateKey' => null
        ));

        return $credentials;
    }
1079391
public function getCredentials()
    {
        $rc_file = $this->parse();
        if ( array_key_exists('username',$rc_file) && array_key_exists('username',$rc_file)) {
            return [$rc_file['username'],$rc_file['token']];
        }
    }
712996
public function getAuthorization()
    {
        if (!$this->hasHeader('Authorization')) {
            return null;
        }
        $temp = explode(' ', trim($this->getHeaderLine('Authorization')), 2);
        switch (strtolower($temp[0])) {
            case 'basic':
                $temp[1] = base64_decode($temp[1]);
                $temp[1] = explode(':', $temp[1], 2);
                return ['username' => $temp[1][0], 'password' => $temp[1][1] ?? null];
            case 'token':
            case 'oauth':
            case 'bearer':
                return ['token' => $temp[1] ?? null];
            default:
                return null;
        }
    }
1005568
def get_credentials(self):
        
        return ReadOnlyCredentials(
            self.access_token, self.client_id, self.client_secret,
            self.refresh_token
        )
797461
public function getServerCredentials()
    {
        if (is_null($this->server)) {
            return [];
        }

        return isset($this->servers[$this->server]) ? $this->servers[$this->server] : [];
    }
1339554
public function getConnectionsCredentials()
    {
        $connectionName = null;
        if ($this->connections) {
            $this->presentConnections($this->connections);
            if ($this->command->confirm('Do you want to add a connection to this?', false)) {
                $connectionName = $this->command->ask('What do you want to name it?');
            }
        } else {
            $connectionName = $this->command->ask('No connections have been set, let\'s create one, what do you want to name it?', 'production');
        }

        // If the user does not want to add any more connection
        // then we can quit
        if (!$connectionName) {
            return $this->connections;
        }

        $this->getConnectionCredentials($connectionName);

        return $this->getConnectionsCredentials();
    }
77508
protected function fetchKeys()
	{
		if($this->keyField===false)
			return array_keys($this->rawData);
		$keys=array();
		foreach($this->getData() as $i=>$data)
			$keys[$i]=is_object($data) ? $data->{$this->keyField} : $data[$this->keyField];
		return $keys;
	}
63436
public function getAuthenticationsAsArray()
    {

        // initialize the array for the authentications
        $authentications = array();

        // iterate over the authentication nodes and sort them into an array
        /** @var \AppserverIo\Appserver\Core\Api\Node\AuthenticationNode $authenticationNode */
        foreach ($this->getAuthentications() as $authenticationNode) {
            $authentications[$authenticationNode->getUri()] = $authenticationNode->getParamsAsArray();
        }

        // return the array
        return $authentications;
    }