Retrieves the correct STS endpoint URL. Useful for federated AAD configurations.

@param $login string

@return null|string
@throws \Exception
979875
protected function getSTSUrl( $login ) {
        $content = [ 'login' => $this->settings->username, 'xml' => 1 ];

        $cURLHandle = curl_init();
        curl_setopt( $cURLHandle, CURLOPT_URL, 'https://login.microsoftonline.com/GetUserRealm.srf' );
        curl_setopt( $cURLHandle, CURLOPT_RETURNTRANSFER, 1 );
        curl_setopt( $cURLHandle, CURLOPT_TIMEOUT, Client::getConnectorTimeout() );

        if ( $this->settings->caPath ) {
            curl_setopt( $cURLHandle, CURLOPT_CAINFO, $this->settings->caPath );
        }

        if ( $this->settings->ignoreSslErrors ) {
            curl_setopt( $cURLHandle, CURLOPT_SSL_VERIFYPEER, 0 );
            curl_setopt( $cURLHandle, CURLOPT_SSL_VERIFYHOST, 0 );
        }

        curl_setopt( $cURLHandle, CURLOPT_SSLVERSION, defined( 'CURL_SSLVERSION_TLSv1_2' )? CURL_SSLVERSION_TLSv1_2 : 6 );

        if( $this->settings->proxy ) {
          curl_setopt( $cURLHandle, CURLOPT_PROXY, $this->settings->proxy );
        }

        curl_setopt( $cURLHandle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1 );
        curl_setopt( $cURLHandle, CURLOPT_HTTPHEADER, [ 'Content-Type: application/x-www-form-urlencoded' ] );
        curl_setopt( $cURLHandle, CURLOPT_POST, 1 );
        curl_setopt( $cURLHandle, CURLOPT_POSTFIELDS, http_build_query( $content ) );
        curl_setopt( $cURLHandle, CURLOPT_FOLLOWLOCATION, true ); // follow redirects
        curl_setopt( $cURLHandle, CURLOPT_POSTREDIR, 7 ); // 1 | 2 | 4 (301, 302, 303 redirects mask)
        curl_setopt( $cURLHandle, CURLOPT_HEADER, false );

        /* Execute the cURL request, get the XML response */
        $responseXML = curl_exec( $cURLHandle );

        /* Check for cURL errors */
        if ( curl_errno( $cURLHandle ) != CURLE_OK ) {
            throw new \Exception( 'cURL Error: ' . curl_error( $cURLHandle ) );
        }
        /* Check for HTTP errors */
        $httpResponse = curl_getinfo( $cURLHandle, CURLINFO_HTTP_CODE );
        $curlInfo = curl_getinfo( $cURLHandle );
        $curlErrNo = curl_errno( $cURLHandle );
        curl_close( $cURLHandle );

        if ( empty( $responseXML ) ) {
            throw new \Exception( 'Empty response from the GetUserRealm endpoint.' );
        }

        if ( strpos( $responseXML, '<IsFederatedNS>true</IsFederatedNS>' ) === false ) {
            return null;
        }

        preg_match( '~<STSAuthURL>(.*?)</STSAuthURL>~', $responseXML, $stsMatch );
        $authUri = $stsMatch[1];

        return preg_replace( '~^https?://(.*?)/.*$~', 'https://$1/adfs/services/trust/13/usernamemixed', $authUri );
    }
1104315
public function getToken(string $login, string $pass): GetTokenResponse
    {
        $response = $this->request('GET', 'getToken', [
            'login' => $login,
            'pass' => $pass,
        ]);

        return $this->converter->getResponseObject(GetTokenResponse::class, $response);
    }
218304
public function getUser(Login $login)
    {
        // check if we have the oauth_server attribute
        if (!$login->getAttribute('oauth2_server')) {
            throw new UserNotFoundException('User not found.');
        }
        // try to get the user from oauth
        $oauth2 = $login->getAttribute('oauth2_server');
        try {
            $oauth2User = $oauth2->request()->getUserDetails();

            // fire the event
            $eventClass = new OAuth2Event($oauth2User, $oauth2);
            $this->eventManager()->fire(OAuth2Event::OAUTH2_AUTH_SUCCESS, $eventClass);
        } catch (\Exception $e) {
            $this->httpSession()->delete('oauth_token');
            throw new UserNotFoundException($e->getMessage());
        }

        // create the user object
        $user = new User();
        $user->populate($oauth2User->email, '', $login->getAttribute('oauth2_roles'), true);

        return $user;
    }
220193
protected function GetErrorURL($sStepName = '')
    {
        if (empty($sStepName)) {
            $sStepName = 'shipping';
        }
        $sURL = false;
        $oShippingStep = TdbShopOrderStep::GetStep($sStepName);
        /** @var $oShippingStep TdbShopOrderStep */
        if (!is_null($oShippingStep)) {
            $sURL = $oShippingStep->GetStepURL(true, true);
            if ('/' == substr($sURL, -1)) {
                $sURL = substr($sURL, 0, -1);
            }
        }

        return $sURL;
    }
505627
public function getAuthenticationEndpoint() {
        switch ( $this->authMode ) {
            case 'OnlineFederation':
                return $this->crmRegion;
            case 'Federation':
                return $this->organizationUrl;
            default:
                throw new \InvalidArgumentException( 'Unsupported authentication mode: ' . $this->authMode );
        }
    }
310423
public function findByLogin($login)
	{
		$model = $this->createModel();

		$user = $model->where($model->getLoginName(), '=', $login)->find();

		if ( ! $user->loaded() )
		{
			throw new UserNotFoundException("A user could not be found with a login value of [$login].");
		}

		return $user;
	}
318240
public function getPlayerPosition($login)
    {
        return isset($this->positionPerPlayer[$login]) ? $this->positionPerPlayer[$login] : null;
    }
310572
public function getPostLoginUrl($resetSessionPostLoginUrl = false)
    {
        $result = $this->getSessionPostLoginUrl($resetSessionPostLoginUrl);
        if ($result === '') {
            $result = $this->getDefaultPostLoginUrl();
            if ($result === '') {
                $result = $this->getFallbackPostLoginUrl();
            }
        }

        return $result;
    }
1062875
public function getConfigurationFile( $serverName, $login){
        $service = sprintf( self::API_VPN_USER_CONFIG, $serverName, $login);
        $rest = $this->getService( $service);
        $rest->getConfig()->setIsReturnToJsonDecode( false);
        $rest->setIsResponseToCheck( false);
        $rest->GET();

        return $rest->getCurlResponse();
    }
777879
public function getGroupLabel($login)
    {
        $group = $this->adminGroupsHelper->getLoginUserGroups($login);

        $groupName = "Admin";
        if ($group) {
            if ($groupName) {
                $groupName = $this->adminGroupsHelper->getGroupLabel($group->getName());
            }
        }

        return $groupName;
    }
1320570
public function getServerChatLines($login)
    {
        static $lockAcquired = false;

        if (isset($this->servers[$login])) {
            $cacheKey = $this->_getServerChatCacheKey($login);
            $cacheResult = $this->serverInfoCache->fetch($cacheKey);
            if ($cacheResult) {
                return $cacheResult;
            } else if (!$lockAcquired) {
                // We don't have the lock, we need to get it before asking the dedicated.

                // Start Protected code.
                $this->semaphore->aquire($cacheKey);
                $lockAcquired = true;

                // Ask for data again, if cache filled from other instance then data from cache, if not wil do a call.
                $data = $this->getServerChatLines($login);

                // End protected code.
                $lockAcquired = false;
                $this->semaphore->release($cacheKey);

                return $data;
            } else {
                $data = array();
                try {
                    $connection = $this->getConnection($login);
                    if ($connection) {
                        $data = $connection->getChatLines();
                    }
                } catch (\Exception $e) {

                }
                $this->serverInfoCache->save($cacheKey, $data, $this->cacheTimeOutChat);

                return $data;
            }
        }

        return null;
    }
53378
public function findByLogin($login)
	{
		$model = $this->createModel();

		if ( ! $user = $model->newQuery()->where($model->getLoginName(), '=', $login)->first())
		{
			throw new UserNotFoundException("A user could not be found with a login value of [$login].");
		}

		return $user;
	}
776971
public function getLoginGroupLabel($login)
    {
        $group = $this->getLoginUserGroups($login);

        $groupName = "Admin";
        if ($group) {
            if ($groupName) {
                $groupName = $this->getGroupLabel($group->getName());
            }
        }

        return $groupName;
    }
917076
public function getByLoginField($login)
    {
        $filter = new IteratorFilter();
        $filter->addRelation($this->getUserDefinition()->loginField(), Relation::EQUAL, strtolower($login));

        return $this->getUser($filter);
    }
475652
public function loginAvailable($login)
    {
        $returnValue = (bool) false;

		if(!empty($login)){
			$returnValue = !$this->loginExists($login);
		}

        return (bool) $returnValue;
    }
407228
public function findUserByLogin($login)
    {
        if ($login instanceof UserInterface) {
            return $login;
        }

        $result =   $this->userProvider->findByLogin($login);
        if ($result) {
            return $result;
        }

        $exceptionMessage   =   "A user with the login '%(login)s' cannot be found.";

        throw new UserNotFound(isprintf($exceptionMessage, compact('login')));
    }
1056831
public function getPassRequestDataByLogin($login) 
    {
        $table = $this->getServiceLocator()->get('MelisLostPasswordTable');
        $data = $table->getEntryByField('rh_login', $login);
        
        if($data)
            return $data;
    }