How can i disable auth bearer token for specific API route?

I have the following API route:
 

    /**
     * @Route("/api/v{version}/whic/tastings/archive/init", name="api.action.whic.tastings.init", methods={"POST"})
    */
    public function get_stats(Request $request, Context $context): JsonResponse
    {
        $client = new Client([
            'base_uri' => $this->baseUrl,
            'timeout' => 10.0
        ]);

        $result = $client->request('POST', '/api/external/archive/init', [
            'query' => [
                'product' => $_GET['product']
            ]
        ]);
        $output = json_decode($result->getBody()->getContents());

        return new JsonResponse($output);
    }

I need to disable token auth to this route.
How can i have this accomplished on SW6?

Solved this through Slack. Got some help there.
Solution is easy:

 

Add „defaults={„auth_required“=false}“ to the Annotation @Route

2 Likes