Gets the current authorization token.
@return \MangoPay\Libraries\OAuthToken Currently stored token instance or null.
548660
public function Get()
    {
        $filename = $this->GetPathToFile();
        if (!file_exists($filename)) {
            return null;
        }
        
        $data = file_get_contents($filename);
        if ($data === false) {
            return null;
        }
        
        $serialized = str_replace($this->_prefixContent, '', $data);
        return unserialize($serialized);
    }
595557
protected function getTokenForRequest()
	{
		$token = $this->request->input( $this->inputKey );

		if ( empty( $token ) )
			$token = $this->request->bearerToken();

		if ( empty( $token ) )
			$token = $this->request->getPassword();

		return $token;
	}
769809
protected function getTokenFromHeader()
    {
        // if there is no authorization header present.
        if (!$this->getRequest()->headers->has('Authorization')) {
            // abort by returning null.
            return null;
        }

        // gets the full header string.
        $header = $this->getRequest()->headers->get('Authorization');

        // returns the token without the 'Bearer ' prefix.
        return Str::replaceFirst('Bearer ', '', $header);
    }
840394
public function getToken()
    {
        if(isset($this->_tokens[$this->_position])) {
            return $this->_tokens[$this->_position];
        } else {
            return null;
        }
    }
1311412
public function get_access_token() {
        if (isset ($this->ll_access_token) && !is_null($this->ll_access_token)) {
            return $this->ll_access_token;
        }

        $app_client_values = array(
            'client_id' => $this->client_id,
            'client_secret' => $this->client_secret,
            'grant_type' => 'client_credentials'
        );

        $access_data = MPRestClient::post(array(
            "uri" => "/oauth/token",
            "data" => $app_client_values,
            "headers" => array(
                "content-type" => "application/x-www-form-urlencoded"
            )
        ));

        if ($access_data["status"] != 200) {
            throw new MercadoPagoException ($access_data['response']['message'], $access_data['status']);
        }

        $this->access_data = $access_data['response'];

        return $this->access_data['access_token'];
    }
201690
public function current() {
    if ($this->position >= $this->length) {
      return NULL;
    }
    return $this->tokens[$this->position];
  }
268829
public function getAccessToken() {
        if (!is_null($this->_cachedAccessToken) &&
            $this->_cachedAccessToken->isValid()) {
            return $this->_cachedAccessToken;
        }

        $this->_cachedAccessToken = $this->acquireAccessToken();
        return $this->_cachedAccessToken;
    }
993180
protected function getAuthToken()
    {
        $token = $this->request->getHeader('X_AUTHORIZATION');
        if (!$token) {
            $request = $this->getDI()->get('request');
            $token = $request->getQuery('token') ?: $request->getPost('token');
        }

        $token = trim(str_ireplace('Token:', '', $token));
        if (strlen($token) < 30) {
            throw new HTTPException('Unauthorized access blocked', 401, [
                'dev' => 'Supplied Token: ' . $token,
                'code' => '98914681681864674'
            ]);
        }
        return $token;
    }
621518
protected function get_stored_token() {
        global $SESSION;

        $name = $this->get_tokenname();

        if (isset($SESSION->{$name})) {
            return $SESSION->{$name};
        }

        return 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;
    }
1287924
static public function getToken()
    {
        if ( self::$token === null )
        {
            self::$token = sha1( self::getSecret() . self::getIntention() . session_id() );
        }

        return self::$token;
    }
1069547
public function getAccessToken() {
        if (!empty($this->accessToken)) {
            return $this->accessToken;
        }
        $accessToken = $this->sessionStorage->read('access_token');
        if (!empty($accessToken)) {
            $this->accessToken = $accssToken;
            return $this->accessToken;
        }

        $this->exchangeToken();

        return $this->accessToken;
    }
662237
public function getAccessToken()
    {
        // Get the signed request URL
        $response = $this->fetch('POST', API::API_URL, self::ACCESS_TOKEN_METHOD);
        $token = $this->parseTokenString($response['body']);
        $this->storage->set($token, 'access_token');
    }
1252466
protected function current_token(){
		if( !isset($this->tok) ){
			$this->tok = current( $this->input );
			$this->t = self::token_to_symbol( $this->tok );
		} 
		return $this->tok;
	}
936985
protected function getToken()
    {
        $query = $this->request->getQueryParams();
        $temp = $this->getSessionData('Socialite.oauth.temp');
        return $this->server->getTokenCredentials(
            $temp,
            A::get($query, 'oauth_token'),
            A::get($query, 'oauth_verifier')
        );
    }
299800
public function getToken($authorization_code = null) {

		if ($authorization_code == null) {
			$authorization_code = $this->getAuthorizationCode();
		}

		$params = $_SESSION[$this->oauth_key];
		unset($_SESSION[$this->oauth_key]);

		$response = $this->client->post('oauth/token', [
			'client_id'		=> $this->client->id(),
			'grant_type'	=> 'authorization_code',
			'code'			=> $authorization_code,
			'scope'			=> $params['scope'],
			'redirect_uri'	=> $params['redirect_uri'],
		]);
		return $response->data('token');
	}
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']}");
    }