Okay here is my answer ( which works of course )
1) you need to override fosUserBundle SecurityController and routing to add your custom code :
Copy from FOS\UserBundle\Controller\SecurityController
To your bundle ( for example : Acme\UserBundle\Controller
Copy from FOS\UserBundle\Ressources\config\routing\security.xml
To your bundle ( for example : Acme\UserBundle\Ressources\config\routing\security.xml
2) in your app\config\routing.yml
Change :
fos_user_security:
resource: "@FOSUserBundle/Resources/config/routing/security.xml"
To :
fos_user_security:
resource: "@ACMEUserBundle/Resources/config/routing/security.xml"
( ACME here is you app name )
3) in your Acme\UserBundle\Controller\SecurityController.php
Add the following ( after line 43 ):
/**
* Custom login if we want to prefill login with an online user email
*/
if ( $lastUsername === null && $request->get('email') != '' )
$lastUsername = $request->get('email');
Now we are able to use login in both standard mode and custom mode which allow to switch between online users from different devices without loosing security .
i m conscious that having an email in get parameter isn't very clean code, but this project is running through an webview in a mobile app and the url is never displayed .
the code should be updated in case of post method .