Is there any option to turn off WebserviceAuthenticator and make it public custom api in pimcore?

I create new custom web api but i can use this api using apikey as parameter but i want make it public no need this apikey parameter. But when I remove this there is error coming in api : “API request needs either a valid API key or a valid session” so i want to my web api public.

My Code:

<?php
   namespace AppBundle\Controller\Rest;
   use Pimcore\Controller\FrontendController;
   use Pimcore\Model\DataObject;
   use Symfony\Component\HttpFoundation\Request;
   use Symfony\Component\HttpFoundation\Response;
   use Symfony\Component\Routing\Annotation\Route;
   use Pimcore\Model\DataObject\ProductCategory;
   use Pimcore\Bundle\AdminBundle\Controller\Rest\AbstractRestController;
   use Pimcore\Bundle\AdminBundle\HttpFoundation\JsonResponse;

   class CategoryRestController extends AbstractRestController
   {

/**
 * @Route("/webservice/rest/categories" , methods={"GET"}) 
 */
public function categoriesAction(Request $request)
{
    $categories = new ProductCategory\Listing();

    foreach ($categories as $key => $category) {
        $data[] =    $category->jsonSerialize();
    }

    return $this->Json(["success" => true, "data" => $data]);
  }   
  }

Hi,

If you implements your own methods, you can simply extend Pimcore\Controller\FrontendController instead of AbstractRestController.

@geraudi This was also i tried But there is also problem is coming if i am using “/webservice/rest/example” route.