protected function createServer(): ResourceServer
    {
        // Init our repositories
        $accessTokenRepository = new AccessTokenRepository(); // instance of AccessTokenRepositoryInterface

        // Path to authorization server's public key
        $publicKeyPath = Environment::getEnv('OAUTH_PUBLIC_KEY_PATH');

        // Relative paths to the web root
        $publicKeyPath = str_replace('{BASE_DIR}', Director::baseFolder(), $publicKeyPath);

        // Setup the authorization server
        return new ResourceServer(
            $accessTokenRepository,
            $publicKeyPath
        );
    }