Get the request/access token
This will return the access/request token depending on
which stage we are at in the OAuth flow, or a dummy object
if we have not yet started the authentication process
@return object stdClass
342120
private function getToken()
    {
        if (!$token = $this->storage->get('access_token')) {
            if (!$token = $this->storage->get('request_token')) {
                $token = new \stdClass();
                $token->oauth_token = null;
                $token->oauth_token_secret = null;
            }
        }
        return $token;
    }
1260265
protected function getOauth()
    {
        if (null == $this->oauth) {
            $this->oauth = $this->createOauth();
        }

        return $this->oauth;
    }
1244078
protected function requestAuthorizationToken(): string
    {
        $result = $this->options->getAuthorizationToken();
        if ($result === '') {
            $authRequest = new AuthRequest();
            $authRequest->setAgent($this->options->getAgent())
                        ->setAccessKey($this->options->getAccessKey())
                        ->setEnabledModNames($this->options->getEnabledModNames());

            $authResponse = $this->fetchResponse($authRequest);
            if ($authResponse instanceof AuthResponse) {
                $result = $authResponse->getAuthorizationToken();
                $this->options->setAuthorizationToken($result);
            }
        }
        return $result;
    }
547162
public function token()
    {
        $response = $this->oauthServer->handleTokenRequest(Request::createFromGlobals());
        if (!$response->isSuccessful()) {
            return $this->response->sendError(
                ResponseCodes::AUTH_ERROR,
                $response->getStatusCode(),
                $response->getParameter('error_description')
            );
        } else {
            return $this->response->sendSuccess($response->getParameters());
        }
    }
153341
function getToken()
    {
        if (! $this->token )
            $this->token = $this->exchangeToken();
        elseif (\Poirot\OAuth2Client\checkExpiry( $this->token->getDateTimeExpiration() ))
            $this->token = $this->exchangeToken();


        return $this->token;
    }
1143366
public function getACLRequest()
    {
        $operation = array(
            'API' => 'GetBucketACL',
            'Method' => 'GET',
            'Uri' => '/<bucket-name>?acl',
            'Headers' => array(
                'Host' => $this->properties['zone'] . '.' . $this->config->host,
            ),
            'Params' => array(
            ),
            'Elements' => array(
            ),
            'Properties' => $this->properties,
            'Body' => null
        );
        $this->getACLValidate($operation);
        $req = new Request($this->config, $operation);
        return $req;
    }
441510
public function getOAuthToken()
    {
        if (!$this->isStateless()) {
            return \Cache::get('oauth.temp');
        } else {
            /** @var TemporaryCredentials $temp */
            $temp = unserialize(\Cache::get('oauth_temp'));

            return $temp->getIdentifier();
        }
    }
691615
protected function getOauthMiddleware()
    {
        if (!$this->oauthMiddleware) {
            if (!$this->isLoggedIn()) {
                throw new \RuntimeException('Not logged in');
            }

            $grant = new ClientCredentials();
            $grantOptions = [];

            // Set up the "exchange" (normal) API token type.
            if ($this->config['api_token'] && $this->config['api_token_type'] !== 'access') {
                $grant = new ApiToken();
                $grantOptions['api_token'] = $this->config['api_token'];
            }

            $this->oauthMiddleware = new GuzzleMiddleware($this->getProvider(), $grant, $grantOptions);
            $this->oauthMiddleware->setTokenSaveCallback(function (AccessToken $token) {
                $this->saveToken($token);
            });

            // If an access token is already available (via an API token or via
            // the session) then set it in the middleware in advance.
            if ($accessToken = $this->loadToken()) {
                $this->oauthMiddleware->setAccessToken($accessToken);
            }
        }

        return $this->oauthMiddleware;
    }
55041
protected function getToken()
    {
        /* @var ResponseInterface $response */
        $response = $this->post(self::TOKEN_URI, [
            'body' => [
                'grant_type' => 'authorization_code',
                'code' => $this->getCodeQueryField(),
                'client_id' => $this->clientId,
                'client_secret' => $this->clientSecret
            ]
        ]);

        if ($response->getStatusCode() == 200) {
            $this->setPropertiesBasedOnSuccessResponse($response->json());

            return;
        }

        $response = $response->json();
        throw new OAuthException("{$response['error']}:{$response['error_description']}");
    }
620160
protected function getToken()
    {
        $temp = $this->request->session()->get('oauth.temp');

        return $this->server->getTokenCredentials(
            $temp, $this->request->get('oauth_token'), $this->request->get('oauth_verifier')
        );
    }
154734
public function getAccessToken()
    {
        if ($this->accessToken === null) {
            $headers = array('Content-Type' => 'application/x-www-form-urlencoded');
            $content = array(
                'grant_type'     => 'assertion',
                'assertion_type' => 'http://oauth.net/grant_type/jwt/1.0/bearer',
                'assertion'      => $this->generateJsonWebToken(),
            );

            $response = json_decode($this->httpAdapter->postContent($this->url, $headers, $content));

            if (isset($response->error)) {
                throw GoogleAnalyticsException::invalidAccessToken($response->error);
            }

            $this->accessToken = $response->access_token;
        }

        return $this->accessToken;
    }
1000514
public function getRequestToken()
    {
        return md5($this->getMerchantId().$this->getTransactionReference().$this->getAmount().$this->getSecretWord());
    }
1224002
protected function acquireAccessToken()
	{
		$accessToken = parent::acquireAccessToken();

		if ($this->cache !== null)
			$this->cache->put($this->accessToken);

		return $accessToken;
	}
693255
public function getAccessToken()
    {
        $session = $this->getClient()->getConnector()->getSession();
        $token = $session->get('accessToken');
        $expires = $session->get('expires');
        if (!$token || $expires < time()) {
            // Force a connection to the API to ensure there is an access token.
            $this->getMyAccount(true);
            if (!$token = $session->get('accessToken')) {
                throw new \RuntimeException('No access token found');
            }
        }

        return $token;
    }
705262
public function getAccessToken()
    {
        $accessTokenAttribute = $this->accessTokenAttribute;
        return (is_string($accessTokenAttribute) && !empty($accessTokenAttribute)) ? $this->$accessTokenAttribute : null;
    }
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;
    }
1136701
public function getToken()
  {

    if ($this->has('token'))
    {
      return $this->get('token');
    }

    if ($this->has('access_token'))
    {
      return $this->get('access_token');
    }

    if ($this->has('accessToken'))
    {
      return $this->get('accessToken');
    }

    if ($authorization = $this->getHeader('AUTHORIZATION'))
    {
      return $authorization;
    }

    return null;
  }