Simple quick method to set shop and access token in one shot.

@param string $shop        The shop's domain
@param string $accessToken The access token for API requests

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

        return $this;
    }
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();
    }
160033
public static function create($accessToken = '')
    {
        $client = ClientFactory::create();
        $responseTransformer = new ArrayBodyTransformer();
        $apiExceptionTransformer = new GuzzleTransformer();

        return new Api($client, $responseTransformer, $apiExceptionTransformer, $accessToken);
    }
561444
public static BaseResult shopClean(String accessToken, ShopInfo shopInfo) {
        return shopClean(accessToken, JsonUtil.toJSONString(shopInfo));
    }
309764
public static ProductCreateResult productCreate(String accessToken, ProductCreate productCreate) {
        return productCreate(accessToken, JsonUtil.toJSONString(productCreate));
    }
426029
public function setAccessTokenCacheFile($accessTokenCacheFile)
	{
		if (is_dir($accessTokenCacheFile))
			$accessTokenCacheFile .= DIRECTORY_SEPARATOR;

		$this->accessTokenCacheFile = $accessTokenCacheFile;

		return $this;
	}
1329233
public function setAccessTokenFromParams($accessToken)
    {
        $existingAccessToken = $this->getAccessToken();
        if (!$existingAccessToken) {
            $this->setAccessToken($accessToken);
        } elseif ($accessToken !== $existingAccessToken) {
            throw new SteeinSDKException('Ошибка доступа к токенам. Токен доступа, указанный в запросе SteeinRequest, и токен, указанный в параметрах URL или POST, не совпадают.');
        }

        return $this;
    }
488209
public function setAccessToken($accessToken)
    {
        $this->accessToken = $accessToken;
        $this->username = '';
        $this->password = '';
        $this->token = '';
        return $this;
    }
286316
public function validateAccessToken($accessToken = null)
	{
		try
		{
			$this->getOpenID($accessToken);
			return true;
		}
		catch(ApiException $e)
		{
			return false;
		}
	}
469319
public static BaseResult shopUpdate(String accessToken, ShopUpdate shopUpdate) {
        return shopUpdate(accessToken, JsonUtil.toJSONString(shopUpdate));
    }
1068034
public void setoAuthAccessToken(OAuthAccessToken oAuthAccessToken) {
    this.oAuthAccessToken = oAuthAccessToken;
    this.accessToken = new Token(oAuthAccessToken.getOauthToken(), oAuthAccessToken.getOauthTokenSecret());
  }
704045
public function verifyAccessToken($accessToken)
    {
        $jwtPayload = $this->decodeAccessToken($accessToken);

        $expectedIss = sprintf('https://cognito-idp.%s.amazonaws.com/%s', $this->region, $this->userPoolId);
        if ($jwtPayload['iss'] !== $expectedIss) {
            throw new TokenVerificationException('invalid iss');
        }

        if ($jwtPayload['token_use'] !== 'access') {
            throw new TokenVerificationException('invalid token_use');
        }

        if ($jwtPayload['exp'] < time()) {
            throw new TokenExpiryException('invalid exp');
        }

        return $jwtPayload['username'];
    }
390021
public function setSmtp($shop = null)
    {
        $myConfig = Registry::getConfig();
        $shop = ($shop) ? $shop : $this->_getShop();

        $smtpUrl = $this->_setSmtpProtocol($shop->oxshops__oxsmtp->value);

        if (!$this->_isValidSmtpHost($smtpUrl)) {
            $this->setMailer("mail");

            return;
        }

        $this->setHost($smtpUrl);
        $this->setMailer("smtp");

        if ($shop->oxshops__oxsmtpuser->value) {
            $this->_setSmtpAuthInfo($shop->oxshops__oxsmtpuser->value, $shop->oxshops__oxsmtppwd->value);
        }

        if ($myConfig->getConfigParam('iDebug') == 6) {
            $this->_setSmtpDebug(true);
        }
    }
290793
public function store ($hash, AccessToken $accessToken)
    {
        $key = $this->prefix . $hash;
        $contents = json_encode($accessToken);

        $this->memcached->set($key, $contents);
    }
144956
public function setDefaultAccessToken($accessToken)
    {
        if (is_string($accessToken)) {
            $this->defaultAccessToken = new AccessToken($accessToken);
        }
        if ($accessToken instanceof AccessToken) {
            $this->defaultAccessToken = $accessToken;
        }

       // throw new \InvalidArgumentException('Токен ключ по умолчанию должен быть типа string или \Steein\SDK\Authentication\AccessToken');
    }
565342
public synchronized void refreshWithToken(String clientToken, String accessToken) throws AuthenticationException {
		authResult = authenticationService.refresh(Objects.requireNonNull(clientToken), Objects.requireNonNull(accessToken));
	}
1198890
private static function initAccessToken($accessToken)
    {
        if (is_array($accessToken)) {
            return new AccessToken($accessToken);
        } elseif (is_a($accessToken, '\League\OAuth2\Client\Token\AccessToken')) {
            return $accessToken;
        } else {
            return null;
        }
    }