/**
  * Return an OPAuth account.
  * If an account with the given data does not exist a new account will be created.
  *
  * @param \Hfrahmann\Opauth\Opauth\Response $opauthResponse
  * @return \TYPO3\Flow\Security\Account
  * @throws \Hfrahmann\Opauth\Exception
  */
 public function getAccount(\Hfrahmann\Opauth\Opauth\Response $opauthResponse)
 {
     if ($opauthResponse == NULL) {
         throw new \Hfrahmann\Opauth\Exception("OpauthResponse cannot be NULL.", 1381596921);
     }
     $accountIdentifier = $this->createAccountIdentifier($opauthResponse);
     $authenticationProviderName = $this->configuration->getAuthenticationProviderName();
     $account = $this->accountRepository->findByAccountIdentifierAndAuthenticationProviderName($accountIdentifier, $authenticationProviderName);
     if ($account === NULL) {
         $roleIdentifier = $this->configuration->getDefaultRoleIdentifier();
         $roleIdentifierArray = array();
         if (is_array($roleIdentifier)) {
             $roleIdentifierArray = $roleIdentifier;
         }
         if (is_string($roleIdentifier)) {
             $roleIdentifierArray = array($roleIdentifier);
         }
         $account = $this->accountFactory->createAccountWithPassword($accountIdentifier, NULL, $roleIdentifierArray, $authenticationProviderName);
     }
     return $account;
 }