Get the azure client.

@param string[] $auth

@return \MicrosoftAzure\Storage\Blob\Internal\IBlob
964568
protected function getClient(array $auth)
    {
        $endpoint = sprintf('DefaultEndpointsProtocol=https;AccountName=%s;AccountKey=%s', $auth['account-name'], $auth['api-key']);

        return ServicesBuilder::getInstance()->createBlobService($endpoint);
    }
701276
public static function &getAuth($instance)
	{
		static $instances;
		if (!isset($instances)) {
			$instances = array();
		}
		//only create a new authentication instance if it has not been created before
		if (!isset($instances[$instance])) {
			$name = static::getNameFromInstance($instance);

			static::pluginAutoLoad($name);

			$class = '\JFusion\Plugins\\' . $name . '\Auth';
			if (!class_exists($class)) {
				$class = '\JFusion\Plugin\Auth';
			}
			$instances[$instance] = new $class($instance);
		}
		return $instances[$instance];
	}
1288329
public function getAuthSource($key)
    {
        if (!isset($this->authSources[$key])) {
            throw new \InvalidArgumentException(sprintf(
                'There is no AuthSource called "%s". Available are: %s',
                $key,
                implode(', ', array_keys($this->authSources))
            ));
        }

        return $this->container->get($this->authSources[$key]);
    }
1247211
public function getHttpClient()
    {
        if (!is_null($this->httpClient)) {
            return $this->httpClient;
        }

        return $this->httpClient = new Client([
            'base_uri' => $this->storageUrl(),
            'headers' => [
                'X-Auth-Token' => $this->token(),
            ],
        ]);
    }
125612
public function getClient($name)
    {
        if (!isset($this->serverArray[$name])) {
            $name   = $this->defaultName;
        }

        if (isset($this->clientArray[$name])) {
            try {
                $this->clientArray[$name]->ping();
            } catch (\RedisException $ex) {
                $this->clientArray[$name] = $this->createClient($this->serverArray[$name]);
            }
            return $this->clientArray[$name];
        }

        $this->clientArray[$name] = $this->createClient($this->serverArray[$name]);
        return $this->clientArray[$name];
    }
319807
private function getClient($clientName)
    {
        if (!array_key_exists($clientName, $this->clients)) {
            throw new InvalidArgumentException(sprintf('The elastica client with name "%s" is not defined', $clientName));
        }

        return $this->clients[$clientName]['reference'];
    }
225164
public static function authenticateRequest($auth)
    {
        // this is a little tricky. We have TWO ways of doing this
        // 1. Does the security token for jobs md5 correctly? If so, good.

        $val = \Core::make('config/database')->get('concrete.security.token.jobs') . ':' . DIRNAME_JOBS;
        if (md5($val) == $auth) {
            return true;
        }
    }
1110256
protected function getClient(array $config)
    {
        $client = new CloudsearchClient( 
            $config['client_id'], 
            $config['client_secret'], 
            $config['host'],
            'aliyun'
        );

        $search = new CloudsearchSearch($client);
        $search->addIndex($config['app']);

        return $search;
    }
55673
public function getClient($name = null)
    {
        if (null === $name) {
            $name = $this->defaultClientName;
        }

        if (in_array($name, $this->getClientNames())) {
            return $this->clients[$name];
        }

        throw new \InvalidArgumentException(($name === null ? 'default client' : 'client ' . $name) . ' not configured');
    }
965729
protected function getClient(array $config): Client
    {
        $client = Client::create($config['url']);

        $client->authenticate(
            $config['token'],
            array_get($config, 'method', Client::AUTH_URL_TOKEN),
            array_get($config, 'sudo', null)
        );

        return $client;
    }
608248
public static function fetch( $accessToken, $authCheck = true )
    {
        $tokenInfo = null;
        $session = ezcPersistentSessionInstance::get();
        $q = $session->createFindQuery( __CLASS__ );
        $e = $q->expr;

        $q->innerJoin( 'ezprest_clients', 'ezprest_token.client_id', 'ezprest_clients.client_id' );
        if ( $authCheck )
        {
            $q->innerJoin( 'ezprest_authorized_clients', $e->lAnd( $e->eq( 'ezprest_authorized_clients.rest_client_id', 'ezprest_clients.id' ),
                                                                   $e->eq( 'ezprest_authorized_clients.user_id', 'ezprest_token.user_id' ) ) );
        }

        $q->where( $q->expr->eq( 'ezprest_token.id', $q->bindValue( $accessToken ) ) );
        $tokenInfo = $session->find( $q, 'ezpRestToken' );
        if ( !empty( $tokenInfo ) )
        {
            $tokenInfo = array_shift( $tokenInfo );
        }
        else // Empty array. For consistency in result, cast it to null
        {
            $tokenInfo = null;
        }

        return $tokenInfo;
    }
734113
private static function getInstance(
        string $userName,
        Auth $auth
    ) : RawEndpoint {
        return new RawEndpoint(
            $userName,
            $auth,
            new Client()
        );
    }
1089990
public static function decodeCredentials($token, $auth) {
        try {
            return JWT::decode($token, $auth['key'], array('HS256'));
        } catch (SignatureInvalidException $e) {
            abortAuth(SignatureInvalidException::class);
        } catch (ExpiredException $e) {
            abortAuth(ExpiredException::class);
        }
    }
1115832
public function getClient($clientId)
    {
        ValidationUtility::ensureStringOrInteger('$clientId', $clientId);

        return $this->callServiceGetApi(
            '\Authlete\Dto\Client::fromJson',
            self::$CLIENT_GET_API_PATH . $clientId);
    }
1371076
private function getClient()
    {
        if ($this->client === null) {
            $this->client = new $this->clientClassName($this->config->hostname, [
                'credentials' => \Grpc\ChannelCredentials::createInsecure(),
            ]);
        }

        return $this->client;
    }
464831
public function client(array $config)
    {
        $key = $this->getClientKey($config);

        if (isset($this->clients[$key])) {
            return $this->clients[$key];
        }

        return $this->clients[$key] = $this->createClient($config);
    }
112110
public function data($name, $options = null, $auth = null)
	{
		if ($this->options && !$options)
		{
			$options = $this->options;
		}

		if ($this->auth && !$auth)
		{
			$auth = $this->auth;
		}

		switch (strtolower($name))
		{
			case 'plus':
				return new Data\Plus($options, $auth);

			case 'picasa':
				return new Data\Picasa($options, $auth);

			case 'adsense':
				return new Data\Adsense($options, $auth);

			case 'calendar':
				return new Data\Calendar($options, $auth);

			default:
				return null;
		}
	}