Clear the authorization state of a given service

@param string $service

@return TokenStorageInterface
960678
public function clearAuthorizationState($service)
    {
        $service = $this->normalizeServiceName($service);

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

        return $this;
    }
1110367
private function clearTokenBuffer(array $buffer)
    {
        foreach ($buffer as $bufferItem) {
            // Clear out associated access token
            if ($bufferItem instanceof AccessToken) {
                // We have to use this method of retrieving the entity because the refresh token
                // is not accurately being set on the Access token entity for some reason.
                $refreshToken = $this->entityManager->getRepository(RefreshToken::class)
                    ->findOneByAccessToken($bufferItem);
                if ($refreshToken) {
                    $this->entityManager->remove($refreshToken);
                }
            }

            // Clear out associated refresh token
            if ($bufferItem instanceof RefreshToken) {
                $accessToken = $bufferItem->getAccessToken();
                if ($accessToken) {
                    $this->entityManager->remove($accessToken);
                }
            }

            $this->entityManager->remove($bufferItem);
        }

        $this->entityManager->flush();
    }
1280515
public function storeCSRFState(string $service, string $state):OAuthStorageInterface{
		$this->states[$service] = $state;

		return $this;
	}
542694
protected function isTokenLoaded( $service ) {
        return ( array_key_exists( $service, $this->tokens ) && ( $this->tokens[$service] instanceof SecurityToken ) );
    }
1242572
public function getMiddlewareFromContainer(
        string $service
    ): MiddlewareInterface{
        if($this->container->has($service)){
            $middleware = $this->container->get($service);
        }elseif(class_exists($service)){
            $middleware = $this->container->getInstance($service);
        }else{
            throw new \LogicException;
        }

        if(!$middleware instanceof MiddlewareInterface){
            throw new \LogicException;
        }

        return $middleware;
    }
602093
protected function propagate($service)
    {
        // Propagate the service manager
        if ($service instanceof ServiceLocatorAwareInterface) {
            $service->setServiceLocator($this->getServiceLocator());
        }

        // Propagate the logger service
        if ($service instanceof LoggerAwareInterface) {
            $logger = null;
            if ($this instanceof TaoLoggerAwareInterface) {
                $logger = $this->getLogger();
            } else {
                if ($this->getServiceLocator()->has(LoggerService::SERVICE_ID)) {
                    $logger = $this->getServiceLocator()->get(LoggerService::SERVICE_ID);
                }
            }
            if (!is_null($logger)) {
                $service->setLogger($logger);
            }
        }

        return $service;
    }
267425
protected function getService( $service){
        $rest = new utils\rest\RestAuth( $this->application->getFreeboxApiHost() . $service);
        $rest->setSessionToken( $this->application->getSessionToken());
        return $rest;
    }
985246
public function hasAccessToken(string $service):bool {
		return isset($this->tokens[$service]) && $this->tokens[$service] instanceof AccessToken;
	}
631887
public function setService($key, $service)
    {
        $this->set($key, $service);
        unset($this->instanceCache[$key]);
        return $this;
    }
1197812
public function load( $service ){
          
             // is overwrite class specified 
            $class = array_key_exists($service, $this->webServices)
                    ? new $this->webServices[$service]
                    : $this;
            
            $class->build( $service );
            
            return $class;
      }
1149349
public function getService($service = null)
    {
        if ( $service and ! array_key_exists($service, $this->service) )
        {
            $this->setService($service);
        }

        $this->setToken();

        return $this->service[$service];
    }
63716
public function clearCSRFState(string $service):OAuthStorageInterface{

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

		return $this;
	}
7847
public function hasAccessToken(string $service):bool{
		return isset($_SESSION[$this->sessionVar], $_SESSION[$this->sessionVar][$service]);
	}
445622
public function remove($service)
    {
        if ($this->has($service)) {
            unset($this->container[$service]);
            return true;
        } else {
            trigger_error(sprintf(
                'Attempted to un-register non-existing service "%s"', $service
            ));

            return false;
        }
    }
777513
public function hasCSRFState(string $service):bool {
		return isset($this->states[$service]) && null !== $this->states[$service];
	}
92148
protected function retrieveToken( $service ) {
        $stsUri = $this->getSTSUrl( $this->settings->username );

        if ( $stsUri !== null ) {
            $assertResponse = $this->client->attemptSoapResponse( $stsUri, function() use ( $stsUri ) {
                return $this->generateAssertRequest( $stsUri );
            } );

            $assertToken = $this->extractAssertToken( $assertResponse );

            $tokenResponse = $this->client->attemptSoapResponse( 'sts', function() use ( $assertToken ) {
                return $this->generateAssertTokenRequest( $assertToken );
            } );
        } else {
            $tokenResponse = $this->client->attemptSoapResponse( 'sts', function() use ( $service ) {
                return $this->generateTokenRequest( $service );
            } );
        }

        $token = $this->extractToken( $tokenResponse );

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

        return $token;
    }
1199824
function withScoped(array $services) {
        foreach ($services as $method => $type) {
            $this->bind($method, $type, self::SCOPED);
        }
        return $this;
    }