Checks whether security token for given service is loaded into memory.

@param string $service

@return bool
542694
protected function isTokenLoaded( $service ) {
        return ( array_key_exists( $service, $this->tokens ) && ( $this->tokens[$service] instanceof SecurityToken ) );
    }
730950
public function getCSRFState(string $service):string{

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

		throw new OAuthStorageException('state not found');
	}
1050832
public static function enabled($service)
    {
        $service = strtolower($service);

        return get_config_value('connect.'.$service.'_enable', true) && self::getConsumer($service)->isValid();
    }
238331
public static function getAPI($service)
    {
        $service = strtolower($service);
        $identifier = 'com:connect.oauth.service.'.$service;
        if (!AnService::has($identifier)) {
            $config = array();
            $config['consumer'] = self::getConsumer($service);
            $config['enabled'] = self::enabled($service);
            AnService::set($identifier, AnService::get($identifier, $config));
        }

        return    AnService::get($identifier);
    }
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?');
    }
1127345
public function register($name, $service, $args = [], $isParam = false)
    {
        if (!$isParam && !$this->hasService($name)) {
            $this->registeredList['services'][$name] = [
                'class' => $service,
                'arguments' => $args,
            ];

            return true;
        } elseif ($isParam && !$this->hasParam($name)) {
            $this->registeredList['params'][$name] = $service;

            return true;
        }

        return false;
    }
415685
public function isVersionedService()
    {
        if ($this->def->getService() === null || !$this->def->getService()->getVersioning()) {
            return false;
        }

        return (boolean) $this->def->getService()->getVersioning();
    }
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;
    }
429265
public function has($serviceName)
    {
        if ($this->classes->resolve($serviceName, false) !== false) {
            return true;
        }

        return $this->registry->has($serviceName);
    }
267425
protected function getService( $service){
        $rest = new utils\rest\RestAuth( $this->application->getFreeboxApiHost() . $service);
        $rest->setSessionToken( $this->application->getSessionToken());
        return $rest;
    }
1302420
public function checkToken($method = 'post') {
        $token = $this->getFormToken();

        if (!$this->input->$method->get($token, '', 'alnum')) {
            if ($this->getSession()->isNew()) {
                // Redirect to login screen.
                $this->redirect('/login');
                $this->close();
            }

            return false;
        }

        return true;
    }
194686
public static function check( $token )
    {
        $token_name = 'token';

        if(Session::exists($token_name) && $token == Session::exists($token_name) )
        {
            Session::delete($token_name);
            return true;
        }
        return false;
    }
1047756
public function hasService(string $serviceKey): bool
    {
        try {
            $this->getService($serviceKey);
        } catch (MissingServiceException $e) {
            return false;
        }
        return true;
    }
308784
public static function getToken ($token, string $service)
	{
		switch ($service)
		{
			case GeoEnum::AppleMapKit:
			case MapTiles::MapKitStandard:
			case MapTiles::MapKitMutedStandard:
			case MapTiles::MapKitSatellite:
			case MapTiles::MapKitHybrid:
				return JWT::getToken(
					trim($token['privateKey']),
					trim($token['keyId']),
					trim($token['teamId'])
				);
			default:
				return $token;
		}
	}
1136462
public function getCSRFState(string $service):string{

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

		throw new OAuthStorageException('state not found');
	}
227048
public function initializeConfig($service)
    {
        if (function_exists('config_path') &&
            file_exists(config_path('pushnotification.php')) &&
            function_exists('app')
        ) {
            $configuration = app('config')->get('pushnotification');
        } else {
            $configuration = include(__DIR__ . '/Config/config.php');
        }

        if (!array_key_exists($service, $configuration)) {
            throw new PushNotificationException("Service '$service' missed in config/pushnotification.php");
        }
        return $configuration[$service];
    }
52866
public function clearAccessToken(string $service):OAuthStorageInterface{

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

		return $this;
	}