public function onLogin(WordpressEvent $event)
    {
        $wpUser = $event->getParameter('user');

        $user = $this->userManager->find($wpUser->data->ID);
        $user->setWordpressRoles($wpUser->roles);

        $token = new UsernamePasswordToken($user, $user->getPass(), $this->firewall, $user->getRoles());
        $this->tokenStorage->setToken($token);

        $this->session->set('_security_'.$this->firewall, serialize($token));
    }
public function onLogin(WordpressEvent $event)
    {
        $wpUser = $event->getParameter('user');

        $user = $this->userManager->find($wpUser->data->ID);
        $user->setWordpressRoles($wpUser->roles);

        $token = new UsernamePasswordToken($user, $user->getPass(), $this->firewall, $user->getRoles());
        $this->tokenStorage->setToken($token);

        $this->session->set('_security_'.$this->firewall, serialize($token));
    }
public function onLogin ( WordpressEvent $ event ) { $ wpUser = $ event -> getParameter ( 'user' ) ; $ user = $ this -> userManager -> find ( $ wpUser -> data -> ID ) ; $ user -> setWordpressRoles ( $ wpUser -> roles ) ; $ token = new UsernamePasswordToken ( $ user , $ user -> getPass ( ) , $ this -> firewall , $ user -> getRoles ( ) ) ; $ this -> tokenStorage -> setToken ( $ token ) ; $ this -> session -> set ( '_security_' . $ this -> firewall , serialize ( $ token ) ) ; }
Wordpress user login hook method.

@param WordpressEvent $event

@see http://codex.wordpress.org/Plugin_API/Action_Reference/wp_login
Wordpress user login hook method .