/**
  * Tries to authenticate the given token. Sets isAuthenticated to TRUE if authentication succeeded.
  *
  * @param \TYPO3\Flow\Security\Authentication\TokenInterface $authenticationToken The token to be authenticated
  * @throws \TYPO3\Flow\Security\Exception\UnsupportedAuthenticationTokenException
  * @return void
  */
 public function authenticate(\TYPO3\Flow\Security\Authentication\TokenInterface $authenticationToken)
 {
     if (!$authenticationToken instanceof OpauthToken) {
         throw new \TYPO3\Flow\Security\Exception\UnsupportedAuthenticationTokenException('This provider cannot authenticate the given token.', 1381598908);
     }
     $response = $this->opauth->getResponse();
     if ($response !== NULL && $response->isAuthenticationSucceeded()) {
         $accountIdentifier = $this->accountService->createAccountIdentifier($response);
         $authenticationProviderName = $this->name;
         $account = $this->accountRepository->findByAccountIdentifierAndAuthenticationProviderName($accountIdentifier, $authenticationProviderName);
         if ($account !== NULL) {
             $authenticationToken->setAccount($account);
             $authenticationToken->setAuthenticationStatus(\TYPO3\Flow\Security\Authentication\TokenInterface::AUTHENTICATION_SUCCESSFUL);
         }
     } else {
         $authenticationToken->setAuthenticationStatus(\TYPO3\Flow\Security\Authentication\TokenInterface::NO_CREDENTIALS_GIVEN);
     }
 }