FOSUserBundle with ajax authentication

What is required for json response from server?

/AppBundle/Handler/AuthenticationHandler.php

/AppBundle/Resources/config/services.yml

/app/config/security.yml

How to send login request?

You can use jquery for example: