In my first Symfony2 app the users have to submit three values to login. Username, password and domain. They are on the login form and being submitted according to Firebug but the listener that is supposed to be creating a token is not able to get the values. I had hoped it would be as a simple as this:
class UMListener implements ListenerInterface
{
protected $securityContext;
protected $authenticationManager;
public function __construct(SecurityContextInterface $securityContext, AuthenticationManagerInterface $authenticationManager)
{
$this->securityContext = $securityContext;
$this->authenticationManager = $authenticationManager;
}
public function handle(GetResponseEvent $event)
{
$request = $event->getRequest();
$token->setUser($request->get('_username'));
$token->password = $request->get('_password');
$token->domain = $request->get('_domain');
}
I have checked that the parameters are _username, _password and _domain, and when I print_r the $request I can’t see them anywhere :/
Don’t you just hate it when the very next Google search brings up the answer. Changing
to
did the trick