You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to be able to get the authentication token. My use case is as follows: I want to make checks less stringent when an impersonation is in progress.
Injecting the Security service does not provide a solution.
use Symfony\Bundle\SecurityBundle\Security;
public function checkPostAuth(UserInterface $user): void
{
$this->security->getToken(); // null
}
I saw that in Symfony\Component\Security\Http\EventListener\UserCheckerListener the token could be provided as second parameter to the checkPostAuth method. So it could be posible to achieve some things like knowing if an impersonation is in progress.
What do you think about this proposal?
Kind regards,
Fabien
Example
No response
The text was updated successfully, but these errors were encountered:
Welp, this is troublesome :/
One could probably use $this->requestStack->getCurrentRequest()->headers->get('authorization') as a temporary (and somewhat ugly) workaround
Description
Hi there,
When using a custom user checker, ie:
I would like to be able to get the authentication token. My use case is as follows: I want to make checks less stringent when an impersonation is in progress.
Injecting the Security service does not provide a solution.
I saw that in
Symfony\Component\Security\Http\EventListener\UserCheckerListener
the token could be provided as second parameter to the checkPostAuth method. So it could be posible to achieve some things like knowing if an impersonation is in progress.What do you think about this proposal?
Kind regards,
Fabien
Example
No response
The text was updated successfully, but these errors were encountered: