public function getUser()
 {
     $user = false;
     if ($this->isServiceResponsible()) {
         $loginPid = $this->extConf['basic.']['login_pid'];
         $urlParts = ['scheme' => GeneralUtility::getIndpEnv('TYPO3_SSL') ? 'https' : 'http', 'host' => GeneralUtility::getIndpEnv('HTTP_HOST')];
         $additionalUrlParts = ['query' => 'id=' . $loginPid . '&no_cache=1&logintype=login&tx_pxhybridauth_login[provider]=' . $this->provider . '&pid=' . $this->userRecordStoragePage . '&tx_pxhybridauth_login[redirect_url]=' . $this->redirectUrl . '&tx_pxhybridauth_login[redirect_pid]=' . $this->redirectPid];
         ArrayUtility::mergeRecursiveWithOverrule($urlParts, $additionalUrlParts);
         $returnUrl = HttpUtility::buildUrl($urlParts);
         $this->signalSlotDispatcher->dispatch(__CLASS__, 'returnUrl', [&$returnUrl, $this]);
         $additionalUrlParts = ['query' => 'id=' . $loginPid . '&no_cache=1&tx_pxhybridauth_login[login_error]=1&tx_pxhybridauth_login[provider]=' . $this->provider];
         ArrayUtility::mergeRecursiveWithOverrule($urlParts, $additionalUrlParts);
         $returnUrlNoUser = HttpUtility::buildUrl($urlParts);
         $this->signalSlotDispatcher->dispatch(__CLASS__, 'returnUrlNoUser', [&$returnUrlNoUser, $this]);
         $socialUser = $this->singleSignOnUtility->authenticate($this->provider, $returnUrl);
         $user = $this->fetchUserRecordByIdentifier($socialUser->identifier);
         if (isset($user['username'])) {
             $this->login['uname'] = $user['username'];
         }
         $this->signalSlotDispatcher->dispatch(__CLASS__, 'getUser', [&$user, $socialUser, $this]);
         // redirect to px_hybrid_auth login box, when no user found
         if (!$user) {
             HttpUtility::redirect($returnUrlNoUser);
         }
     }
     return $user;
 }
 /**
  * create action
  *
  * @param \Portrino\PxHybridAuth\Domain\Model\Identity $identity
  * @ignorevalidation $identity
  *
  * @return void
  */
 public function createAction(\Portrino\PxHybridAuth\Domain\Model\Identity $identity = null)
 {
     if ($this->feUserObj != null) {
         $return_url = $this->uriBuilder->getRequest()->getRequestUri();
         /** @var \Hybrid_User_Profile $socialUser */
         $socialUser = $this->singleSignOnUtility->authenticate($identity->getProvider(), $return_url);
         $this->signalSlotDispatcher->dispatch(__CLASS__, 'beforeCreateAction', [$this, &$socialUser, $identity]);
         if ($socialUser) {
             $identity->setIdentifier($socialUser->identifier);
             $this->feUserObj->addIdentity($identity);
             $this->userRepository->update($this->feUserObj);
         }
         $this->signalSlotDispatcher->dispatch(__CLASS__, 'afterCreateAction', [$this, $socialUser, $identity]);
     }
     $this->redirect('list', 'Identity');
 }