根据帐号是否授权获取不同的Access token

@return string
513500
public function getAccessTokenByAuth()
    {
        if ($this->accessToken) {
            return $this->accessToken;
        }

        if ($this->authed) {
            $this->accessToken = $this->wechatComponentApi->getAuthorizerAccessToken(
                $this->getAppId(),
                $this->getRefreshToken()
            );
        } else {
            $this->getAccessToken();
        }

        return $this->accessToken;
    }
609639
public function getGroup(){
        if (!$this->access_token && !$this->checkAuth()) return false;
        $result = $this->http_get(self::API_URL_PREFIX.self::GROUP_GET_URL.'access_token='.$this->access_token);
        if ($result)
        {
            $json = json_decode($result,true);
            if (isset($json['errcode'])) {
                $this->errCode = $json['errcode'];
                $this->errMsg = $json['errmsg'];
                return false;
            }
            return $json;
        }
        return false;
    }
1115971
protected function getAccessToken()
    {
        $response = $this->httpClient
            ->post(
                self::ENDPOINT_ACCESS_TOKEN,
                array(
                    'grant_type'    => 'client_credentials',
                    'client_id'     => $this->config['client_id'],
                    'client_secret' => $this->config['client_secret'],
                    'scope'         => implode(',', $this->config['scopes'])
                )
            )
        ;

        $data = json_decode($response->getContent(), true);

        if (json_last_error() !== JSON_ERROR_NONE) {
            $ex = new HttpResponseException('[access_token] Invalid JSON: '. json_last_error_msg());
            $ex
                ->setResponse($this->httpClient->getLastResponse())
                ->setRequest($this->httpClient->getLastRequest())
            ;

            throw $ex;
        }

        if (false === array_key_exists('access_token', $data)) {
            throw new HttpResponseException('access_token is missing from response. '. $response->getContent());
        }

        return $data;
    }
104890
public function getToken(): string
    {
        return $this->cache->remember($this->tokenKey, $this->tokenTTL, function () {
            return $this->fetchToken();
        });
    }
944111
protected function accessTokenMiddleware()
    {
        return function (callable $handler) {
            return function (RequestInterface $request, array $options) use ($handler) {
                if (!$this->accessToken) {
                    return $handler($request, $options);
                }
                $token = $this->accessToken->getToken();

                $uri = $request->getUri();
                $path = $uri->getPath();
                $path .= 'access_token/' . $token . '/sf_appid/' . $this->accessToken->getAppId() .  '/sf_appkey/' . $this->accessToken->getAppKey();
                $uri = $uri->withPath($path);
                $request = $request->withUri($uri);

                Log::debug("attache access token : {$uri}");
                Log::debug("attache path : {$path}");
                return $handler($request, $options);
            };
        };
    }
1366884
public function getAccessToken()
    {
        if (null === $this->accessTokens) {
            $this->accessTokens = [];
        }

        if (!array_key_exists($this->getRegion(), $this->accessTokens)) {
            $this->accessTokens[$this->getRegion()] = $this->requestAccessToken();
        }

        return $this->accessTokens[$this->getRegion()]->getToken();
    }
249965
public function accessToken(){
		$url = 'https://api.dropbox.com/1/oauth/access_token';
		$result = $this->doOAuthCall($url,'POST');
		parse_str($result['body'], $output);
		if (!count(array_diff(array('oauth_token','oauth_token_secret','uid'),
			array_keys($output))))
		{
			$this->setAuthToken($output['oauth_token'], $output['oauth_token_secret']);
			return $output;
		} else {
			$result = json_decode($result['body'], true);
			trigger_error(sprintf(self::E_AUTHERROR, $result['error']));
			return false;
		}
	}
42202
public function getOauthAccessToken()
    {
        $code = isset($_GET['code']) ? $_GET['code'] : '';
        if (empty($code)) {
            Tools::log("getOauthAccessToken Fail, Because there is no access to the code value in get.", "MSG - {$this->appid}");
            return false;
        }
        $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::OAUTH_TOKEN_URL . "appid={$this->appid}&secret={$this->appsecret}&code={$code}&grant_type=authorization_code");
        if ($result) {
            $json = json_decode($result, true);
            if (empty($json) || !empty($json['errcode'])) {
                $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505';
                $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解析接口返回内容！';
                Tools::log("WechatOauth::getOauthAccessToken Fail.{$this->errMsg} [{$this->errCode}]", "ERR - {$this->appid}");
                return false;
            }
            return $json;
        }
        return false;
    }
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;
    }
746606
public function getAccessToken()
  {
    $token = $this->getAuth()->getAccessToken();
    // The response is json encoded, so could be the string null.
    // It is arguable whether this check should be here or lower
    // in the library.
    return (null == $token || 'null' == $token || '[]' == $token) ? null : $token;
  }
150775
public function getToken()
    {
        if (Cache::has(self::CACHE_NAME)) {
            return Cache::get(self::CACHE_NAME);
        } else {
            $url    = $this->url."token";
            $option = [
                'grant_type'    => 'client_credentials',
                'client_id'     => $this->client_id,
                'client_secret' => $this->client_secret,
            ];
            $return = Http::postCurl($url, $option);
            Cache::put(self::CACHE_NAME, $return['access_token'], (int) ($return['expires_in'] / 60));

            return $return['access_token'];

        }
    }
977249
public function getAuthorizationToken()
    {
        $authorizationToken = "Client-ID {$this->provider->getClientId()}";

        if (! is_null($this->token)) {
            // Validate if the token object link to this class is expire
            // refresh it if it's the case
            if ($this->token->hasExpired()) {
                $this->refreshToken();
            }

            $authorizationToken = "Bearer {$this->token->getToken()}";
        }

        return $authorizationToken;
    }
780641
public function getAuthToken()
    {
        if(!isset($this->__token))
        {
            $token   = false;
            $request = $this->getObject('request');

            if($request->headers->has('Authorization'))
            {
                $header = $request->headers->get('Authorization');

                if(stripos($header, 'jwt') === 0) {
                    $token = substr($header , 4);
                }
            }

            if($request->isSafe())
            {
                if($request->query->has('auth_token')) {
                    $token = $request->query->get('auth_token', 'url');
                }
            }
            else
            {
                if($request->data->has('auth_token')) {
                    $token = $request->data->get('auth_token', 'url');
                }
            }

            if($token) {
                $token = $this->getObject('lib:http.token')->fromString($token);
            }

            $this->__token = $token;
        }

        return $this->__token;
    }
662307
public function getToken()
    {
        $this->token = Cache::get($this->cacheKey);

        // 从缓存中获取不到token或设置了强制刷新
        if (!$this->token || $this->force) {
            $params = array(
                'component_appid'         => Config::get('wechat.componentAppId'),
                'component_appsecret'     => Config::get('wechat.componentAppSecret'),
                'component_verify_ticket' => ComponentVerifyTicket::getTicket(),
            );

            $http = new ComponentHttp();
            $response = $http->jsonPost(self::API_COMPONENT_TOKEN, $params);

            // 设置token
            $this->token = $response['component_access_token'];

            // 把token缓存起来
            $expiresAt = Carbon::now()->addSeconds($response['expires_in']);
            Cache::put($this->cacheKey, $this->token, $expiresAt);
        }

        return $this->token;
    }
95891
public function getBearerToken() {

	    $headers = null;
	    $token   = null;

	    if (isset($_SERVER['Authorization'])) {
	        $headers = \trim($_SERVER['Authorization']);
	    } elseif (isset($_SERVER['HTTP_AUTHORIZATION'])) { //Nginx or fast CGI
	        $headers = \trim($_SERVER['HTTP_AUTHORIZATION']);
	    } elseif (\function_exists('apache_request_headers')) {
	        $requestHeaders = \apache_request_headers();
	        // Server-side fix for bug in old Android versions (a nice side-effect of this fix means we don't care about capitalization for Authorization)
	        $requestHeaders = \array_combine(\array_map('ucwords', \array_keys($requestHeaders)), \array_values($requestHeaders));
	        if (isset($requestHeaders['Authorization'])) {
	            $headers = \trim($requestHeaders['Authorization']);
	        }
	    }

	    // HEADER: Get the access token from the header
	    if ($headers) {
	        if (\preg_match('/Bearer\s(\S+)/', $headers, $matches)) {
	            $token = $matches[1];
	        }
	    }

	    return $token;
	}
255052
public function getAccessToken()
    {
        // get token from cache file
        $result = $this->readAccessToken();
        if ('' != $result) {
            return $result;
        }

        // get token from we chat api
        $data   = $this->getAccessTokenFromWeChat();
        // save token to cache data
        $this->saveAccessToken($data['token'], $data['expire']);

        return $data['token'];
    }
659148
public function getAccessToken($access_token)
    {
        $token = $this->collection('access_token_table')->findOne(array('access_token' => $access_token));
        return is_null($token) ? false : $token;
    }