@param string $service

@return \chillerlan\OAuth\Storage\OAuthStorageInterface
160157
public function clearCSRFState(string $service):OAuthStorageInterface{

		if(array_key_exists($service, $this->states)){
			unset($this->states[$service]);
		}

		return $this;
	}
380109
public function createProxyClassInstance($service)
    {
        $file = $this->getProxyFilename(get_class($service));
        
        if (file_exists($file)) {
            require_once $file;
        } else {
            throw new Exception\RuntimeException(
                sprintf('Proxy class for service "%s" has not been initialized', get_class($service)));
        }
        
        $proxyService = $this->getProxyClassName(get_class($service));
        return new $proxyService($service);
    }
1175350
public function registerService($service, $class)
    {
        $this[$service] = function ($app) use ($class) {
                $inst = new $class;
                if ($inst instanceof FactoryInterface) {
                    return $inst->create($app);
                } else {
                    return $inst;
                }
            };
    }
118309
public function getServiceDescription($service)
    {
        if ($this->serviceIsObject($service)) {
            return get_class($service);
        }
        return $this->formatServiceDescription($service, is_scalar($service));
    }
1149349
public function getService($service = null)
    {
        if ( $service and ! array_key_exists($service, $this->service) )
        {
            $this->setService($service);
        }

        $this->setToken();

        return $this->service[$service];
    }
427556
public function set($name, $service)
    {
        if (isset($this->registry[$name])) {
            unset($this->registry[$name]);
        }
        if (isset($this->instances[$name])) {
            unset($this->instances[$name]);
        }
        if (null === $service) {
            return $this;
        }
        if (! is_string($service)) {
            $this->instances[$name] = $service;

            return $this;
        }
        $this->registry[$name] = $service;

        return $this;
    }
927382
protected function retrieveToken( $service ) {
        $tokenResponse = $this->client->attemptSoapResponse( 'sts', function() use ( $service ) {
            return $this->generateTokenRequest( $service );
        } );

        $securityDOM = new \DOMDocument();
        $securityDOM->loadXML( $tokenResponse );

        $newToken = new SecurityToken();

        $cipherValues = $securityDOM->getElementsByTagName( 'CipherValue' );
        $newToken->securityToken0 = $cipherValues->item( 0 )->textContent;
        $newToken->securityToken1 = $cipherValues->item( 1 )->textContent;

        $newToken->keyIdentifier = $securityDOM->getElementsByTagName( 'KeyIdentifier' )->item( 0 )->textContent;

        $newToken->binarySecret = $securityDOM->getElementsByTagName( 'BinarySecret' )->item( 0 )->textContent;

        if ( $securityDOM->getElementsByTagName( 'SecurityTokenReference' )->item( 0 )->prefix === 'wsse' ) {
            $securityDOM->getElementsByTagName( 'SecurityTokenReference' )->item( 0 )->setAttributeNS( 'http://www.w3.org/2000/xmlns/', 'xmlns:wsse', 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd' );
        }

        $newToken->securityToken = $securityDOM->saveXML( $securityDOM->getElementsByTagName( "RequestedSecurityToken" )->item( 0 )->firstChild );

        $expiryTime = $securityDOM->getElementsByTagName( "RequestSecurityTokenResponse" )->item( 0 )->getElementsByTagName( 'Expires' )->item( 0 )->textContent;
        $newToken->expiryTime = Client::parseTime( substr( $expiryTime, 0, -1 ), '%Y-%m-%dT%H:%M:%S' );

        $this->client->logger->info( 'Issued a new ' . $service . ' security token - expires at: ' . date( 'r', $newToken->expiryTime ) );

        return $newToken;
    }
274046
public function addService($service)
    {
        if (in_array($service, $this->allServices)) {
            $this->services[] = $service;
        }

        return $this;
    }
442610
public function clearToken($service)
    {
        $service = $this->normalizeServiceName($service);

        $tokens = $this->sessionScope->get(self::SESSION_TOKEN);
        if (array_key_exists($service, $tokens)) {
            unset($tokens, $service);
        }
        $this->sessionScope->set(self::SESSION_TOKEN, $tokens);

        return $this;
    }
730950
public function getCSRFState(string $service):string{

		if($this->hasCSRFState($service)){
			return $_SESSION[$this->stateVar][$service];
		}

		throw new OAuthStorageException('state not found');
	}
1212676
public function resolve(string $service): ResolveAllUrlsResponse
    {
        $key = $this->cacheKey($service);
        $item = $this->cache->getItem($key);

        if ($item->isHit()) {
            return $item->get();
        }

        $options = [
            'query' => [
                'schema' => self::SCHEMA_VERSION,
                '_service' => $service,
            ],
        ];

        $response = $this->authenticatedClient->request('GET', static::RESOLVE_ALL_URLS_URL, $options);

        $encoders = [new JsonEncoder()];
        $normalizers = [new UriNormalizer(), new ObjectNormalizer(null, null, null, new PhpDocExtractor()), new ArrayDenormalizer()];
        $serializer = new Serializer($normalizers, $encoders);

        /** @var ResolveAllUrlsResponse $resolved */
        $resolved = $serializer->deserialize($response->getBody(), ResolveAllUrlsResponse::class, 'json');
        $resolved->setService($service);
        $this->saveCache($key, $resolved);

        return $resolved;
    }
608556
public function clearToken($service)
    {
        // get previously saved tokens
        $tokens = Session::get($this->sessionVariableName);

        if (array_key_exists($service, $tokens)) {
            unset($tokens[$service]);
        }

        // Replace the stored tokens array
        Session::set($this->sessionVariableName, $tokens);

        // allow chaining
        return $this;
    }
1365060
private function getKernelContainerService(string $service): object
    {
        /** @var \Symfony\Component\DependencyInjection\ServiceLocator $serviceLocator */
        $serviceLocator = $this->container->get('service_bus.public_services_locator');

        /** @var object $object */
        $object = $serviceLocator->get($service);

        return $object;
    }
811687
public function make($service)
    {
        $service = 'Google_Service_'.ucfirst($service);

        if (class_exists($service)) {
            $class = new \ReflectionClass($service);

            return $class->newInstance($this->client);
        }

        throw new UnknownServiceException($service);
    }
323038
public function createService( ServiceLocatorInterface $services )
    {
        $manager = $services->get( 'Zend\Session\ManagerInterface' );
        $storage = new Session( null, null, $manager );
        return new AuthenticationService( $services, $storage );
    }
83951
public function getToken( $service ) {
        if ( $this->isTokenLoaded( $service ) && !$this->isTokenExpired( $service ) ) {
            return $this->tokens[$service];
        }

        $tokenCacheKey = $this->getTokenCacheKey( $service );

        $cachedToken = $this->client->cache->get( $tokenCacheKey );
        if ( $cachedToken instanceof SecurityToken && !$cachedToken->hasExpired() ) {
            $this->tokens[$service] = $cachedToken; // save in memory

            return $cachedToken;
        }

        $this->tokens[$service] = $newToken = $this->retrieveToken( $service );
        $this->client->cache->set( $tokenCacheKey, $newToken, floor( $newToken->expiryTime - time() - 60 ) );

        return $newToken;
    }
1136462
public function getCSRFState(string $service):string{

		if($this->hasCSRFState($service)){
			return $this->states[$service];
		}

		throw new OAuthStorageException('state not found');
	}