@param string $service

@return TokenInterface

@throws TokenNotFoundException
11392
public function retrieveAccessToken($service)
    {
        $service = $this->normalizeServiceName($service);

        if ($this->hasAccessToken($service)) {
            $tokens = $this->sessionScope->get(self::SESSION_TOKEN);
            return unserialize($tokens[$service]);
        }

        throw new TokenNotFoundException('Token not found in session, are you sure you stored it?');
    }
35354
public function getContainer($service = null)
    {
        return is_null($service) ? ($this->container ?: app()) : ($this->container[$service] ?: app($service));
    }
201004
public function getAccessToken(string $service):AccessToken{

		if($this->hasAccessToken($service)){
			return (new AccessToken)->fromJSON($_SESSION[$this->sessionVar][$service]);
		}

		throw new OAuthStorageException('token not found');
	}
610924
public function getService(string $id)
    {
        if ($this->serviceContainer->has($id)) {
            return $this->serviceContainer->get($id);
        }

        if ($this->reversibleLocator->has($id)) {
            return $this->reversibleLocator->get($id);
        }

        if (isset($this->serviceContainer->getRemovedIds()[$id])) {
            throw new ServiceNotFoundException($id, null, null, [], sprintf('The "%s" service is private and cannot be accessed by reference. You should either make it public, or tag it as "%s".', $id, $this->tagName));
        }

        // will throw a ServiceNotFoundException
        $this->serviceContainer->get($id);
    }
1304303
public function createToken(TokenInterface $token): TokenInterface
    {
        try {
            $now        = $this->ignoreException(function (): DateTimeImmutable {
                return new DateTimeImmutable();
            });
            $schema     = $this->getDatabaseSchema();
            $hasRefresh = $token->getRefreshValue() !== null;
            $values     = $hasRefresh === false ? [
                $schema->getTokensClientIdentityColumn() => $token->getClientIdentifier(),
                $schema->getTokensUserIdentityColumn()   => $token->getUserIdentifier(),
                $schema->getTokensValueColumn()          => $token->getValue(),
                $schema->getTokensTypeColumn()           => $token->getType(),
                $schema->getTokensIsScopeModified()      => $token->isScopeModified(),
                $schema->getTokensIsEnabledColumn()      => $token->isEnabled(),
                $schema->getTokensValueCreatedAtColumn() => $now,
            ] : [
                $schema->getTokensClientIdentityColumn()   => $token->getClientIdentifier(),
                $schema->getTokensUserIdentityColumn()     => $token->getUserIdentifier(),
                $schema->getTokensValueColumn()            => $token->getValue(),
                $schema->getTokensTypeColumn()             => $token->getType(),
                $schema->getTokensIsScopeModified()        => $token->isScopeModified(),
                $schema->getTokensIsEnabledColumn()        => $token->isEnabled(),
                $schema->getTokensValueCreatedAtColumn()   => $now,
                $schema->getTokensRefreshColumn()          => $token->getRefreshValue(),
                $schema->getTokensRefreshCreatedAtColumn() => $now,
            ];

            $tokenIdentifier = null;
            if (empty($scopeIdentifiers = $token->getScopeIdentifiers()) === false) {
                $this->inTransaction(function () use ($values, $scopeIdentifiers, &$tokenIdentifier) {
                    $this->createResource($values);
                    $tokenIdentifier = $this->getLastInsertId();
                    $this->bindScopeIdentifiers($tokenIdentifier, $scopeIdentifiers);
                });
            } else {
                $this->createResource($values);
                $tokenIdentifier = $this->getLastInsertId();
            }

            $token->setIdentifier($tokenIdentifier)->setValueCreatedAt($now);
            if ($hasRefresh === true) {
                $token->setRefreshCreatedAt($now);
            }

            return $token;
        } catch (RepositoryException $exception) {
            $message = 'Token creation failed';
            throw new RepositoryException($message, 0, $exception);
        }
    }
832352
public function get($service)
    {
        // Is the service active?
        if (isset($this->active[$service])) {
            if ($this->loaded[$service]['singleton']) {
                return $this->active[$service];
            } else {
                return $this->load($service);
            }
        } elseif (isset($this->loaded[$service])) {
            // Is the service loaded?
            return $this->load($service);
        }

        $message  = "CDI the service accessed '$service' is not loaded in the DI-container.";
        $services = $this->getServices();
        natcasesort($services);
        $services = implode("\n", $services);
        $message .= " Loaded services are: <pre>$services</pre>";
        
        throw new \Exception($message);
    }
437858
public function validatePlugin($service)
    {
        if ($service instanceof ServiceInterface) {
            return;
        }

        throw new InvalidPluginException(sprintf(
            'Plugin of type %s is invalid; must implement %s\Service\ServiceInterface',
            (is_object($service) ? get_class($service) : gettype($service)),
            __NAMESPACE__
        ));
    }
840133
public function getService($service)
    {
        foreach ($this->queue as $extension) {
            $new = call_user_func($extension, $service, $this->container);

            if ($new) {
                $service = $new;
            }
        }

        return $service;
    }
727481
public function invalidateToken( $service ) {
        unset( $this->tokens[$service] );

        $cacheKey = $this->getTokenCacheKey( $service );
        $this->client->cache->delete( $cacheKey );

        $this->client->logger->notice( 'Invalidated token for ' . ucfirst( $service ) . 'Service' );
    }
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;
    }
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);
    }
466738
public function get($service)
    {
        return $this->has($service) ? $this->container->get($service) : null;
    }
1184128
public function service($service){

	    if(!$this->exists($service)){
	        throw new ServiceNotFoundException(sprintf('Service "%s" not found', $service));
	    }

		return new Worker($this, $service);
	}
636810
private function getServiceUrl(array $service)
    {
        $map = ['username' => 'user', 'password' => 'pass'];
        $urlParts = [];
        foreach ($service as $key => $value) {
            $newKey = isset($map[$key]) ? $map[$key] : $key;
            $urlParts[$newKey] = $value;
        }

        return Url::buildUrl($urlParts);
    }
631887
public function setService($key, $service)
    {
        $this->set($key, $service);
        unset($this->instanceCache[$key]);
        return $this;
    }
587107
public function storeAccessToken(string $service, AccessToken $token):OAuthStorageInterface{
		$token = $token->toJSON();

		if(isset($_SESSION[$this->sessionVar]) && is_array($_SESSION[$this->sessionVar])){
			$_SESSION[$this->sessionVar][$service] = $token;
		}
		else{
			$_SESSION[$this->sessionVar] = [$service => $token];
		}

		return $this;
	}
1070121
public function GetServiceTA($service, $continue = TRUE)
	{
		if (file_exists($this->TA_FOLDER.'TA-'.$this->options['CUIT'].'-'.$service.'.xml')) {
			$TA = new SimpleXMLElement(file_get_contents($this->TA_FOLDER.'TA-'.$this->options['CUIT'].'-'.$service.'.xml'));

			$actual_time 		= new DateTime(date('c',date('U')+600));
			$expiration_time 	= new DateTime($TA->header->expirationTime);

			if ($actual_time < $expiration_time) 
				return new TokenAutorization($TA->credentials->token, $TA->credentials->sign);
			else if ($continue === FALSE)
				throw new Exception("Error Getting TA", 5);
		}

		if ($this->CreateServiceTA($service)) 
			return $this->GetServiceTA($service, FALSE);
	}