public function validateCredentials(UserInterface $user, array $credentials) { if ($user->getUserName($credentials['username']) && $user->getPassword($credentials['password'])) { return true; } return false; }
/** * This is called when an authentication is successful. * * @param Request $request * @param UserInterface $user */ public function set(Request $request, UserInterface $user) { $this->remove(); if (!$this->isRememberMeRequested($request)) { return; } $expires = self::COOKIE_LIFETIME + time(); $value = $this->generateCookieValue($user->getUsername(), $expires, $user->getPassword()); $this->cookie->set($this->name, $value, $expires); }
/** * {@inheritdoc} */ public function validateCredentials(UserInterface $user, array $credentials) { return $this->encoder->verify($user->getPassword(), $credentials['password']); }
/** * Sets the user to be used. * * @param UserInterface $user * @param bool $remember */ public function setUser(UserInterface $user, $remember = false) { $this->handler->write($user->getId(), $remember); $this->user = $user; }