/**
* 认证用户
*/
public function authenticate(User $user, $providerKey)
{
$authenticationToken = new UsernamePasswordToken($user, $user->getPassword(), $providerKey, $user->getRoles());
$authenticationEvent = new InteractiveLoginEvent($this->request, $authenticationToken);
$this->tokenStorage->setToken($authenticationToken);
$this->dispatcher->dispatch(SecurityEvents::INTERACTIVE_LOGIN, $authenticationEvent);
}