How to get an unencrypted authorized user password in the controller?

On the documentation page there is an example:

http://symfony.com/doc/current/security/custom_password_authenticator.html

How do I pass this $token->getCredentials() value to the controller?

I use symfony 3.4

    1 answer 1

    The documentation Symfony\Component\HttpFoundation\Request how to use Symfony\Component\HttpFoundation\Request in the controller. A self-signed authenticator is not needed for this.

    We substitute a typhint in the method, and the symphony itself injects

     use Symfony\Component\HttpFoundation\Request; //... public function indexAction(Request $request) { // ... } 

    We get the parameters from the request:

     $username = $request->request->get('username'); $password = $request->request->get('password'); 

    The request property is the body of a POST / PUT / PATCH request in the form of an associative array.

    If you are trying to find out the password of the user who made the request and did not send the password with this request, you have incorrectly designed your application. No need to store real user passwords.