I get no current User by requests from websocket to symfony backend.
i authenticate my User through route /authapi/v1/applogin
manual with following:
if($passwordEncoder->isPasswordValid($user, $content->password)){
$token = new UsernamePasswordToken($user, null, 'main', $user->getRoles());
$this->get('security.token_storage')->setToken($token);
//$session = $this->requestStack->getSession();
$this->session->set('_security_main', serialize($token));
$event = new InteractiveLoginEvent($request, $token);
$this->tokenStorage->setToken($token); //UsernamePasswordToken
//$JWTManager =
return new JsonResponse(['jwt' => $JWTManager->create($user)]);
}
at this point, the user is logged in and $tokenStorage has the User Object by requests using postman.
now i want to sent a request from a websocket subdomain with authorization header Bearer myjwt token
using axios. Here, the $tokenStorage is null. This means that jwt isnt authenticated fully? what is missing in the auth part?