Set an existing/already retrieved access token

@param array $accessTokenDetails

@return $this
199887
public function setAccessTokenDetails(array $accessTokenDetails)
    {
        $this->_access_token        = isset($accessTokenDetails['access_token']) ? $accessTokenDetails['access_token'] : null;
        $this->_access_token_secret = isset($accessTokenDetails['access_token_secret']) ? $accessTokenDetails['access_token_secret'] : null;
        $this->_expires             = isset($accessTokenDetails['expires']) ? $accessTokenDetails['expires'] : null;
        $this->_refresh_token       = isset($accessTokenDetails['refresh_token']) ? $accessTokenDetails['refresh_token'] : null;

        return $this;
    }
3599
public function setSession(string $shop, string $accessToken)
    {
        $this->setShop($shop);
        $this->setAccessToken($accessToken);

        return $this;
    }
336474
public function setExpiry(int $expires = null):AccessToken{
		$now = time();

		if($expires!== null){
			$expires =  intval($expires);
		}

		$this->expires = self::EOL_UNKNOWN;

		if($expires === 0 || $expires === self::EOL_NEVER_EXPIRES){
			$this->expires = self::EOL_NEVER_EXPIRES;
		}
		elseif($expires > $now){
			$this->expires = $expires;
		}
		elseif($expires > 0 && $expires < self::EXPIRY_MAX){
			$this->expires = $now + $expires;
		}

		return $this;
	}
132183
public function setDefaultAccessToken($token)
    {
        if (is_string($token)) {
            $this->accessToken = new AccessToken(json_decode($token, true));
        } elseif ($token instanceof AccessToken) {
            $this->accessToken = $token;
        } else {
            throw new \Exception("Incorrect access token");
        }
        if ($this->accessToken->hasExpired()) {
            $this->refreshToken();
        }
        return $this->accessToken;
    }
1127143
public function add(AccessToken $accessToken) {
		$lifetime = $accessToken->getExpiryTime() - time();
		$this->cache->set($accessToken->getIdentifier(), $accessToken, array(), $lifetime);
	}
1248574
public function setRegistrationTokens(array $registrationTokens): self
    {
        foreach ($registrationTokens as $registrationToken) {
            $this->addRegistrationToken($registrationToken);
        }

        return $this;
    }
813923
public function setToken($token, $token_secret = '') {
    $this->getOauthPlugin()->setToken($token, $token_secret);
    $this->getConfig()->set('access_token', $token);
    return $this;
  }
426029
public function setAccessTokenCacheFile($accessTokenCacheFile)
	{
		if (is_dir($accessTokenCacheFile))
			$accessTokenCacheFile .= DIRECTORY_SEPARATOR;

		$this->accessTokenCacheFile = $accessTokenCacheFile;

		return $this;
	}
1228606
public function setAccessToken(AccessToken $token)
    {
        $this->container->get('config')
            ->set('access_token', json_encode($token->jsonSerialize()));
    }
1343019
public function updateAccessToken($access_token)
    {
        $this->getEventDispatcher()->addListener('request.before_send', function(Event $event) use($access_token){
            $request = $event['request'];
            $request->setHeader('Authorization ','Bearer '. $access_token);
        });
    }
738310
public function storeAccessToken($userId, AccessToken $accessToken)
    {
        $stmt = $this->db->prepare(
            'INSERT INTO access_tokens (
                user_id, provider_id, issued_at, access_token, token_type, expires_in, refresh_token, scope
             ) 
             VALUES(
                :user_id,
                :provider_id, :issued_at, :access_token, :token_type, :expires_in, :refresh_token, :scope
             )'
        );

        $stmt->bindValue(':user_id', $userId, PDO::PARAM_STR);
        $stmt->bindValue(':provider_id', $accessToken->getProviderId(), PDO::PARAM_STR);
        $stmt->bindValue(':issued_at', $accessToken->getIssuedAt()->format('Y-m-d H:i:s'), PDO::PARAM_STR);
        $stmt->bindValue(':access_token', $accessToken->getToken(), PDO::PARAM_STR);
        $stmt->bindValue(':token_type', $accessToken->getTokenType(), PDO::PARAM_STR);
        $stmt->bindValue(':expires_in', $accessToken->getExpiresIn(), PDO::PARAM_INT);
        $stmt->bindValue(':refresh_token', $accessToken->getRefreshToken(), PDO::PARAM_STR);
        $stmt->bindValue(':scope', $accessToken->getScope(), PDO::PARAM_STR);
        $stmt->execute();
    }
84930
public function setAccessToken(AccessToken $accessToken)
    {
        $this->accessToken = $accessToken;

        if ($this->tokenUpdatedCallback) {
            call_user_func($this->tokenUpdatedCallback, $accessToken);
        }
    }
376330
protected function setTokenStorage(array $tokenStorage): self
    {
        $this->getSessionStorage()->offsetSet($this->getTokenStorageKey(), $tokenStorage);

        return $this;
    }
88779
public function setAccessToken(array $accessToken)
    {
        if (!isset($accessToken['access_token'])) {
            throw new InvalidParamException('The wechat access_token must be set.');
        } elseif(!isset($accessToken['expire'])) {
            throw new InvalidParamException('Wechat access_token expire time must be set.');
        }
        $this->_accessToken = $accessToken;
    }
1371350
public function setAccessControlRequestHeaders(array $accessControlRequestHeaders)
    {
        // Validate all array elements are strings
        foreach ($accessControlRequestHeaders as $h) {
            if (is_string($h) === false) {
                throw new InvalidArgumentException(
                    'An element in array "accessControlRequestHeaders" is not a string'
                );
            }
        }

        $this->accessControlRequestHeaders = $accessControlRequestHeaders;

        return $this;
    }
934931
public function setAccessToken($accessToken)
    {
        $accessToken = trim($accessToken);

        if (!preg_match('/^access_\w+$/', $accessToken)) {
            throw new ApiException("Invalid OAuth access token: '{$accessToken}'. An access token must start with 'access_'.");
        }

        $this->apiKey = $accessToken;
        $this->oauthAccess = true;
        return $this;
    }
1253184
public function setAccessToken($accessToken)
    {
        if (is_string($accessToken)) {
            $accessToken = new AccessToken($accessToken);
        }
        if (is_object($accessToken) && $accessToken instanceof AccessToken) {
            $this->accessToken = $accessToken;
        } else {
            throw new \InvalidArgumentException('$accessToken must be instance of \LinkedIn\AccessToken class');
        }
        return $this;
    }