Get the rackspace client.

@param string[] $auth

@return \OpenCloud\ObjectStore\Resource\Container
17191
protected function getClient(array $auth)
    {
        $client = new OpenStackRackspace($auth['endpoint'], [
            'username' => $auth['username'],
            'apiKey'   => $auth['apiKey'],
        ]);

        $urlType = array_get($auth, 'internal', false) ? 'internalURL' : 'publicURL';

        return $client->objectStoreService('cloudFiles', $auth['region'], $urlType)->getContainer($auth['container']);
    }
1007813
public function authenticate($auth = null)
    {
        if ($auth !== null) {
            $this->auth = $auth;
        }

        return $this->auth;
    }
1108151
public function install(string $remote,
                            string $name,
                            ?string $auth,
                            array $request)
    {
        $url = $this->base_url.'/pull?'.http_build_query([
                    'remote' => $remote,
                    'name' => $name,
                ]
            );

        $header = [];

        if ($auth) {
            $header = [
                ['X-Registry-Auth' => $auth],
            ];
        }

        return $this->curl->post($url, json_encode($request), $header);
    }
1333706
public final function getServerAuthStatus(ClientAuth $clientAuth = null) {
		$serverAuthStatus = new ServerAuthStatus();
		$serverAuthStatus->publicKey = $this->getPublicKey();
		$serverAuthStatus->isSuccess = $clientAuth && $this->isValidAuth($clientAuth);
		return $serverAuthStatus;
	}
516464
public function createSessionAsync(array $args)
    {
        $database = $this->pluck('database', $args);
        $opts = $this->addResourcePrefixHeader([], $database);
        $opts['credentialsWrapper'] = $this->credentialsWrapper;
        $transport = $this->spannerClient->getTransport();

        $request = new CreateSessionRequest([
            'database' => $database
        ]);

        $session = $this->pluck('session', $args, false);

        if ($session) {
            $sessionMessage = new Session($session);
            $request->setSession($sessionMessage);
        }

        return $transport->startUnaryCall(
            new Call(
                'google.spanner.v1.Spanner/CreateSession',
                Session::class,
                $request
            ),
            $opts
        );
    }
747820
public function get($sessionId)
    {
        $result = $this->getConnection()->table('oauth_sessions')
                    ->where('oauth_sessions.id', $sessionId)
                    ->first();

        if (is_null($result)) {
            return;
        }

        return (new SessionEntity($this->getServer()))
               ->setId($result->id)
               ->setOwner($result->owner_type, $result->owner_id);
    }
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;
		}
	}
441938
public function createOauth(array $config = [])
    {
        return new Oauth1(
            array_merge(
                $this->config,
                [
                    'token' => $this->tokenStorage->getAccessToken(),
                    'token_secret' => $this->tokenStorage->getAccessTokenSecret(),
                ],
                $config
            )
        );
    }
899693
public static function getCloudInstance($accessKey, $secretKey, $apiHost, $cloudId)
    {
        $config = array(
            'accounts' => array(
                'default' => array(
                    'access_key' => $accessKey,
                    'secret_key' => $secretKey,
                    'api_host' => $apiHost,
                ),
            ),
            'clouds' => array(
                'default' => array(
                    'id' => $cloudId,
                    'account' => 'default',
                )
            ),
        );

        /** @var \Xabbuh\PandaClient\AbstractApi $api */
        $api = new static($config);

        return $api->getCloud('default');
    }
1105269
public function resolveAuth( $auth )
	{
		$config = Config::get( 'auth.auths.' . $auth );
		$uses = $config['uses'];

		switch ( $uses )
		{
			case 'database':
			{
				$auth = new DatabaseAuth( $config['table'] );
				break;
			}
			case 'eloquent':
			{
				$auth = new EloquentAuth( $config['usrModel'], $config['grpModel'] );
				break;
			}
			default:
			{
				$auth = UniversalBuilder::resolve( $uses );

				if ( is_null( $auth ) )
					throw new AccountException( "We could not resolve the auth [" . $uses . "]" );

				if ( !is_subclass_of( $auth, AccountAuth::class ) )
					throw new \InvalidArgumentException( "The auth [" . $uses . "] must extend the [" . AccountAuth::class . "] class" );
			}
		}

		return $auth;
	}
1261058
private function getAuthProvider($authProvider)
    {
        if (is_null($this->authProvider)) {
            // auth provider config
            $authProviderConfig = $this->getAuthProviderConfig($authProvider);

            // optional params that will be passed to auth provider constructor
            $params = $authProviderConfig->get('Params', [], true);

            try {
                $this->authProvider = $this->factory($authProviderConfig->Driver, $this->authenticationInterface, $params);
            } catch (Exception $e) {
                throw new FirewallException($e->getMessage());
            }
        }

        return $this->authProvider;
    }
32031
public function getOauthClient($forceNew = false)
    {
        if ( ! isset($this->instances[self::CLIENT_OAUTH]) || $forceNew) {
            $this->instances[self::CLIENT_OAUTH] = MeetupOAuthClient::factory($this->getUpdatedOauthConfig());
        }

        return $this->instances[self::CLIENT_OAUTH];
    }
948704
protected function _getAuth($path = null) {
		if ($this->getConfig('autoClearCache') && Configure::read('debug')) {
			Cache::delete($this->getConfig('allowCacheKey'), $this->getConfig('cache'));
		}
		$roles = Cache::read($this->getConfig('allowCacheKey'), $this->getConfig('cache'));
		if ($roles !== false) {
			return $roles;
		}

		if ($path === null) {
			$path = $this->getConfig('allowFilePath');
		}
		$iniArray = $this->_parseFiles($path, $this->getConfig('allowFile'));

		$res = [];
		foreach ($iniArray as $key => $actions) {
			$res[$key] = $this->_deconstructIniKey($key);
			$res[$key]['map'] = $actions;

			$actions = explode(',', $actions);

			if (in_array('*', $actions)) {
				$res[$key]['actions'] = [];
				continue;
			}

			foreach ($actions as $action) {
				$action = trim($action);
				if (!$action) {
					continue;
				}

				$res[$key]['actions'][] = $action;
			}
		}

		Cache::write($this->getConfig('allowCacheKey'), $res, $this->getConfig('cache'));
		return $res;
	}
1264976
public function getOAuth2Client()
    {
        if (!$this->oAuth2Client instanceof OAuth2Client) {
            $app = $this->getApp();
            $client = $this->getClient();
            $this->oAuth2Client = new OAuth2Client($app, $client, $this->getDefaultApiVersion());
        }

        return $this->oAuth2Client;
    }
1179893
public function getClient($attr = '')
    {
        if ($attr == '') {
            return $this->client;
        }

        if (!isset($this->client[$attr])) {
            return self::UNKNOWN;
        }

        return $this->client[$attr];
    }
505205
public function getAuthFactory(): ?Factory
    {
        if (!$this->hasAuthFactory()) {
            $this->setAuthFactory($this->getDefaultAuthFactory());
        }
        return $this->authFactory;
    }
296352
public function getAuthenticationClient()
    {
        if (null === $this->authenticationClient) {
            $this->authenticationClient = new Auth\OAuth2(
                $this->getHttpClient(),
                $this->getOption('client_id'),
                $this->getOption('client_secret')
            );
        }

        return $this->authenticationClient;
    }