Key to for fetching or saving a token.

@param ResourceOwnerInterface $resourceOwner
@param string                 $key
@param string                 $type

@return string
499585
protected function generateKey(ResourceOwnerInterface $resourceOwner, $key, $type)
    {
        return sprintf('_hwi_oauth.%s.%s.%s.%s', $resourceOwner->getName(), $resourceOwner->getOption('client_id'), $type, $key);
    }
1373040
public function authenticateToken(TokenInterface $token, UserProviderInterface $userProvider, $providerKey)
    {
        // The user provider should implement JWTUserProviderInterface
        if (!$userProvider instanceof JWTUserProviderInterface) {
            throw new InvalidArgumentException('Argument must implement interface Auth0\JWTAuthBundle\Security\Core\JWTUserProviderInterface');
        }

        if ($token->getCredentials() === null) {
            $user = $userProvider->getAnonymousUser();
        } else {
            // Get the user for the injected UserProvider
            $user = $userProvider->loadUserByJWT($token->getCredentials());

            if (!$user) {
                throw new AuthenticationException(sprintf('Invalid JWT.'));
            }
        }

        return new PreAuthenticatedToken(
            $user,
            $token,
            $providerKey,
            $user->getRoles()
        );
    }
820755
private function getThrottle($type, $key)
    {
        if (!isset($this->throttles[$type][$key])) {
            throw new \InvalidArgumentException("Invalid throttle type or parameter given.");
        }

        return $this->throttles[$type][$key];
    }
1062550
protected function getToken($type, $tokenRequired = true)
    {
        $token = $this->tokenStorage->getToken();

        if ($tokenRequired && null === $token) {
            throw new RuntimeException(sprintf('The current %s cannot be added in security token because the security token is empty', $type));
        }

        return $token;
    }
692378
public function setOwner($type, $id)
    {
        $this->ownerType = $type;
        $this->ownerId = $id;

        $this->server->getEventEmitter()->emit(new SessionOwnerEvent($this));

        return $this;
    }
593089
public function getByToken(int $id, string $token, int $type = self::TOKEN_TYPE_REMEMBER) : ?Authenticatable
    {
        return $type === self::TOKEN_TYPE_REMEMBER ?  $this->getByRememberToken($id, $token) : $this->getByApiToken($id, $token);
    }
219866
public function tokenCreate(
        $type = Teamspeak::TOKEN_SERVERGROUP,
        $id1,
        $id2 = 0,
        $description = null,
        $customset = null
    ) {
        return $this->privilegeKeyCreate($type, $id1, $id2, $description, $customset);
    }
1001452
public function getRemoteResourceOwner($token)
    {
        $provider = $this->getProvider();

        $realToken = OauthHelper::getRealToken($token);

        switch($this->getOauthVersion())
        {
            case 1:
                return $provider->getUserDetails($realToken);
                break;
            case 2:
                return $provider->getResourceOwner($realToken);
                break;
        }
    }
869686
protected function convertToResource($resource, $mode = 'wb', $type = 'input')
    {
        $resource = is_resource($resource) === true ?
            $resource : @fopen($resource, $mode);

        if (is_resource($resource) === false) {
            $code = $type === 'input' ? 101 : 102;

            throw new ResourceOpenException('Failed to open '.$type.' stream.', $code);
        }

        return $resource;
    }
743132
public function withResourceOwnerVersion($resourceOwnerVersion)
    {
        $resourceOwnerVersion = (int) $resourceOwnerVersion;

        if (in_array($resourceOwnerVersion, [1, 2])) {
            $this->resourceOwnerVersion = $resourceOwnerVersion;
        }

        return $this;
    }
704481
public function getResolverForResource($resource, $type = null){
		if(is_string($resource) && $resource[0] === '/'){
			$dir = dirname($resource);
			$resolver = $this->getResolverForPath($dir);
		}else{
			$resolver = $this->getResolver();
		}
		return $resolver;
	}
1137372
protected function createResourceOwner(array $response, AccessToken $token)
    {
        $user = new OktaResourceOwner($response);

        return $user->setDomain($this->getBaseApiUrl());
    }
368899
protected function redirectAfterSaving($resourcesPath, $key)
    {
        if (request('after-save') == 1) {
            // continue editing
            $url = rtrim($resourcesPath, '/')."/{$key}/edit";
        } elseif (request('after-save') == 2) {
            // continue creating
            $url = rtrim($resourcesPath, '/').'/create';
        } elseif (request('after-save') == 3) {
            // view resource
            $url = rtrim($resourcesPath, '/')."/{$key}";
        } else {
            $url = request(Builder::PREVIOUS_URL_KEY) ?: $resourcesPath;
        }

        admin_toastr(trans('admin.save_succeeded'));

        return redirect($url);
    }
776536
private static function getQueriableResource($type, array $options = [])
    {
        if (!array_key_exists($type, self::$cache['resources']) || self::haveOptionsBeenUpdated($type, $options)) {
            self::$cache['options'][$type] = $options;
            self::$cache['resources'][$type] = new QueriableResource($type, $options);
        }
        return self::$cache['resources'][$type];
    }
894064
public function getQuery($key = null, $default = null, $type = 'string')
    {
        return $this->request->get($key, $default, $type);
    }
1254376
private function loadDefinition($version, $resource, $type, $key = null) : string
    {
        $definition = $this->definition($resource, $version);

        $classPath = $definition->$type;
        if (is_array($classPath) && array_key_exists($key, $classPath)) {
            $classPath = $classPath[$key];
        }

        if ($classPath === null) {
            throw ResourceNotDefinedException::resource($resource, $type);
        }

        return $classPath;
    }
1367497
protected function getByKey($key)
    {
        return $this->propertyBag()
            ->where('resource_id', $this->resource->getKey())
            ->where('key', $key)
            ->first();
    }