Returns auth for further interactions with Vault.

@return Auth
@throws \Vault\Exceptions\TransportException

@throws \Vault\Exceptions\ServerException
@throws \Vault\Exceptions\ClientException
@throws \RuntimeException
@throws \InvalidArgumentException
337960
public function authenticate()
    {
        $response = $this->client->write(
            '/auth/approle/login',
            [
                'role_id' => $this->roleId,
                'secret_id' => $this->secretId,
            ]
        );

        return $response->getAuth();
    }
234216
public function getOAuth()
    {
        if ($this->oauthResponse instanceof InstagramOAuth) {
            return $this->oauthResponse;
        }

        $accessToken = new stdClass;
        $accessToken->access_token = null;

        $this->oauthResponse = new InstagramOAuth($accessToken);

        return $this->oauthResponse;
    }
173713
protected function getAuthForLogin()
	{
		// If a "key" was specified in the auth credentials, we will load it into a
		// secure RSA key instance, which will be used to connect to the servers
		// in place of a password, and avoids the developer specifying a pass.
		if ($this->hasRsaKey())
		{
			return $this->loadRsaKey($this->auth);
		}

		// If a plain password was set on the auth credentials, we will just return
		// that as it can be used to connect to the server. This will be used if
		// there is no RSA key and it gets specified in the credential arrays.
		elseif (isset($this->auth['password']))
		{
			return $this->auth['password'];
		}

		throw new \InvalidArgumentException('Password / key is required.');
	}
500914
public function getAuthority()
    {
        return ($this->getUserInfo() !== '') ? $this->getUserInfo().
        '@' : ''.$this->getHost().($this->getPort() !== '') ? ':'.$this->getPort() : '';
    }
178708
public function getAuthority()
    {
        return ( $this->_user ? $this->_user . '@' : '') . $this->_host . (isset($this->_port) ? ':' . $this->_port : '');
    }
1238412
public function authenticate()
    {
        $code = $this->getMvcEvent()->getRequest()->getQuery('code');
        if(!$code) {
            return new Result(
                $this->authenticationService,
                Result::FAILURE_CREDENTIAL_INVALID,
                array(),
                array("No 'code' available")
            );
        }
        
        try {
            $provider = $this->getProvider();
            $token = $provider->getAccessToken('authorization_code', ['code' => $code]);
            
            $userProfile = $provider->getUserDetails($token);
            
            $res = new OAuth2Result(
                $this->authenticationService,
                Result::SUCCESS,
                $userProfile->uid
            );
            $res->setUserProfile($this->createUserProfile($userProfile));
            
            $res->setAccessToken($token->accessToken);
            $res->setRefreshToken($token->refreshToken);
            $res->setExpiresIn($token->expires);
            
            return $res;
            
        } catch(\Exception $e) {
            return new Result(
                $this->authenticationService,
                Result::FAILURE_CREDENTIAL_INVALID,
                $code,
                array($e->getMessage())
            );
        }
    }
337914
public function getAuthenticate()
    {
        if ($this->authenticate === null) {
            $this->authenticate = new Authenticate($this->getSecretKey(), $this->getAccessKey());
        }
        return $this->authenticate;
    }
347649
public function personalAccessClient()
    {
        if (Passport::$personalAccessClientId) {
            return $this->find(Passport::$personalAccessClientId);
        }

        $client = Passport::personalAccessClient();

        if (! $client->exists()) {
            throw new RuntimeException('Personal access client not found. Please create one.');
        }

        return $client->orderBy($client->getKeyName(), 'desc')->first()->client;
    }
1322161
public function getAccessToken()
    {
        if (! $this->accessTokenEntity instanceof AccessTokenEntity) {
            $this->accessTokenEntity = $this->server->getAccessTokenStorage()->get($this->accessTokenId);
        }

        return $this->accessTokenEntity;
    }
818236
public function getAuthorizationBearer() {
        $allHeaders = array_change_key_case(parent::getHeaders(), CASE_UPPER);

        if (array_key_exists('AUTHORIZATION', $allHeaders)) {
            if (preg_match('/Bearer\s(\S+)/', $allHeaders['AUTHORIZATION'], $matches)) {
                return $matches[1];
            }
        } else {
            throw new \Exception(ExceptionMessages::AUTH_BEARER_NOT_FOUND);
        }
    }
593243
protected function getAuth()
    {
        if (isset($this->auth['username']) && isset($this->auth['password'])) {
            return [$this->auth['username'], $this->auth['password']];
        }
    }
1374106
protected function getAuth() {
        if (!$this->_auth) {
            $this->_auth = new AuthTypesList(
                $this->version,
                $this->solution['accountSid'],
                $this->solution['sid']
            );
        }

        return $this->_auth;
    }
845667
public function getAuthenticatingNamespaceObject() {
		if (!isset($this->options['auth_ns']))
			throw new \Exception("Missing 'auth_ns' configuration option.");

		$namespaceCoid = COIDParser::fromString($this->options['auth_ns']);
		if (COIDParser::getType($namespaceCoid) != COIDParser::COID_ROOT)
			throw new \Exception("The 'auth_ns' configuration option is not a valid namespace/root COID.");
		
		return $this->getObject($namespaceCoid);
	}
721899
public function bindAuth()
    {
        $credentials = [
            'client_id' => env('AUTH_CLIENT_ID'),
            'client_secret' => env('AUTH_CLIENT_SECRET'),
            'username' => env('AUTH_SERVICE_USERNAME'),
            'password' => env('AUTH_SERVICE_PASSWORD'),
        ];

        // Bind token authenticator with its dependencies
        $this->app->bind(Authentication\TokenAuthenticator::class, function (Application $app) use ($credentials) {
            $client = $app->make('ej:sdk:guzzle');
            $cache = $app->make(Repository::class);

            return new Authentication\TokenAuthenticator($client, $cache, $credentials);
        });

        // Bind Authenticator contract to token auth as default implementation
        $this->app->bind(Authentication\Authenticator::class, function (Application $app) use ($credentials) {
            return $app->make(Authentication\TokenAuthenticator::class);
        });
    }
297222
public function getAuthenticationUri()
    {

        if (!$this->canBuildAuthenticationUri()) {
            throw new \RuntimeException(
            	'Cannot build authentication uri, dependencies are missing'
            );
        }

        $uriParams = array(
            'client_id' => $this->clientId,
            'response_type' => 'code',
            'redirect_uri' => $this->redirectUri,
        );

        return $this->authorizeUri . '?' . http_build_query($uriParams);

    }
219752
protected function getAuth()
    {
        if (is_null($this->auth)) {
            $this->auth = app($this->config('auth'));
        }

        return $this->auth;
    }
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;
    }