public function authenticate(TokenInterface $token) { if (!$this->supports($token)) { return; } $ota = $token->getCredentials(); $user = $this->otaProvider->loadUserByOTA($ota); if ($user) { $this->userChecker->checkPostAuth($user); $this->otaProvider->invalidateByOTA($ota); $authenticatedToken = new Token($this->providerKey, $user); $authenticatedToken->setAttributes($token->getAttributes()); $authenticatedToken->setAuthenticated(true); return $authenticatedToken; } }
protected function getToken($key) { $token = new Token($this->providerKey); $token->setCredentials($key); return $this->authenticator->authenticate($token); }