Gets redirect uri (used in redirecting back to client)

@return string
345249
public function getRedirectUri()
    {
        $scopes = array_map(
            function(IScope $scope) {
                return $scope->getId();
            },
            $this->accessToken->getScopes()
        );

        $query = [
            'access_token' => $this->accessToken->getId(),
            'expires_in' => $this->accessToken->getExpiresAt() - time(),
            'token_type' => $this->tokenTypeName,
            'scope' => join(' ', $scopes)
        ];

        if ($this->state) {
            $query['state'] = $this->state;
        }

        ksort($query); // sort query params by key

        return $this->redirectUri . '#' . http_build_query($query);
    }
354751
public function loginUrl()
    {
        $query = 'client_id=' . $this->app->getId() . '&redirect_uri=' . urlencode($this->callback) . '&response_type=code&state=' . $this->state;
        $query .= isset($this->scopes) ? '&scope=' . urlencode(str_replace(',', ' ', implode(',', $this->scopes))) : '';

        return sprintf('%s%s?%s', Constants::API_HOST, Constants::API_AUTH, $query);
    }
694001
private function getURI()
    {
        if (!empty($_SERVER['PATH_INFO'])) {
            $uri = $_SERVER['PATH_INFO'];
        } elseif (!empty($_SERVER['REQUEST_URI'])) {
            $uri = $_SERVER['REQUEST_URI'];
        } else {
            $uri = false;
        }

        if ($uri === '/') {
            $uri = false;
        }

        return trim(preg_replace('/\?.*/', '', $uri), '/');
    }
686315
public function getUrl()
    {
        if ($this->findDocumentRootInScriptFileName() === $this->removeLastSlash($this->root)) {
            return $this->getRequestUri();
        }
        $path = $this->server->get('PATH_INFO');

        return $path;
    }
460889
public function getRequestUri() {

		if (NULL === $this->requestUri) {
			$this->requestUri = $this->prepareRequestUri();
		}

		return $this->requestUri;

	}
417495
public function getAuthorizationURL()
    {
        $url = Config::inst()->get(self::class, 'AuthorizationUrl');
        $params = [
            'client_id' => $this->client_id,
            'redirect_uri' => $this->getRedirectURL(),
            'response_type' => "code",
            'scope' => $this->scopes,
        ];

        return $url . "?" . http_build_query($params);
    }
980409
public function getRedirectUrl()
    {
        $siteId = $this->getSiteId();

        $requestUrl = $this->getRequestUrl();

        $redirect = $this->redirectRepo->getRedirect($requestUrl, $siteId);

        if (!empty($redirect)) {
            return $redirect->getRedirectUrl();
        }

        return null;
    }
836103
private function getUri()
    {
        if (empty($this->uri) && ($this->uri !== false)) {
            $this->uri = $_SERVER['REQUEST_URI'];

            // Remove the parameters from the URI.
            $paramsStart = strpos($this->uri, '?');
            if ($paramsStart !== false) {
                $this->uri = substr($this->uri, 0, $paramsStart);
            }
        }

        return $this->uri;
    }
213806
public function redirectUrl()
    {
        $redirectUrl = $this->getView()->getRequest()->getQuery('_redirect_url');
        $redirectUrlViewVar = $this->getViewVar('_redirect_url');

        if (!empty($redirectUrlViewVar)) {
            $redirectUrl = $redirectUrlViewVar;
        } else {
            $context = $this->Form->context();
            if ($context->val('_redirect_url')) {
                $redirectUrl = $context->val('_redirect_url');
            }
        }

        if (empty($redirectUrl)) {
            return null;
        }

        return $this->Form->hidden('_redirect_url', [
            'name' => '_redirect_url',
            'value' => $redirectUrl,
            'id' => null,
            'secure' => FormHelper::SECURE_SKIP
        ]);
    }
1088288
public function getRedirect()
    {
        if (!$this->isRedirect())
            return null;

        if ($this->isPermanentRedirect())
            return substr($this->name, 19);

        return substr($this->name, 9);
    }
457708
protected static function getRequestUrl()
    {
        $hostname = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : (isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : null);

        if(isset($hostname))
        {
            $protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';

            if(!isset($_SERVER['REQUEST_URI']))
            {
                if(isset($_SERVER['QUERY_STRING']))
                {
                    return $protocol . '://' . $hostname . $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'];
                }
                else
                {
                    return $protocol . '://' . $hostname . $_SERVER['PHP_SELF'];
                }
            }
            else
            {
                return $protocol . '://' . $hostname . $_SERVER['REQUEST_URI'];
            }
        }
        else
        {
            return null;
        }
    }
961970
public function getAuthorizationUrl() 
    {
        $result = null;
        if (!$this->config->hasCredentials()) {
            $this->registerApplication();
        }
        //Return the Authorization URL
        return "https://{$this->config->getMastodonInstance()}/oauth/authorize/?".http_build_query(
            [
            "response_type"    => "code",
            // @todo review usage of singular / plural in redirect_uri
            "redirect_uri"     => $this->config->getRedirectUris(),
            "scope"            => $this->config->getScopes(),
            "client_id"        => $this->config->getClientId(),
            ]
        );
    }
393035
protected function getCurrentUri()
    {
        $uri = isset($_SERVER['REQUEST_URI'])
            ? $_SERVER['REQUEST_URI']
            : false;
        if (!$uri) {
            $uri = $_SERVER['SCRIPT_NAME'];
            if (isset($_SERVER['argv']) || isset($_SERVER['QUERY_STRING'])) {
                $uri .= '?';
                $uri .= isset($_SERVER['argv'])
                    ? $_SERVER['argv'][0]
                    : $_SERVER['QUERY_STRING'];
            }
        }
        return 'http'
            . (isset($_SERVER['HTTPS']) ? 's' : '')
            . '://'
            . $_SERVER['HTTP_HOST']
            . '/'
            . ltrim($uri, '/');
    }
1361801
protected function getCurrentURI()
	{
		$protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://';
		$current_uri = $protocol.$_SERVER['HTTP_HOST'].$this->getRequestURI();
		$parts = parse_url($current_uri);

		$query = '';
		if(!empty($parts['query']))
		{
			$params = array();
			parse_str($parts['query'], $params);
			$params = array_filter($params);
			if(!empty($params))
			{
				$query = '?'.http_build_query($params, '', '&');
			}
		}

		// Use port if non default.
		$port = isset($parts['port']) &&
			(($protocol === 'http://' && $parts['port'] !== 80) || ($protocol === 'https://' && $parts['port'] !== 443)) ? ':'.$parts['port']
				: '';

		// Rebuild.
		return $protocol.$parts['host'].$port.$parts['path'].$query;
	}
948087
protected function _getRedirectUrl()
    {

        // active controller id
        $controllerId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestControllerId();
        $controllerId = $controllerId ? $controllerId . '?' : 'start?';
        $sPosition = '';

        // setting redirect parameters
        foreach ($this->aRedirectParams as $sParamName) {
            $sParamVal = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter($sParamName);
            $sPosition .= $sParamVal ? $sParamName . '=' . $sParamVal . '&' : '';
        }

        // special treatment
        // search param
        $sParam = rawurlencode(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('searchparam', true));
        $sPosition .= $sParam ? 'searchparam=' . $sParam . '&' : '';

        // current page number
        $iPageNr = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('pgNr');
        $sPosition .= ($iPageNr > 0) ? 'pgNr=' . $iPageNr . '&' : '';

        // reload and backbutton blocker
        if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iNewBasketItemMessage') == 3) {
            // saving return to shop link to session
            \OxidEsales\Eshop\Core\Registry::getSession()->setVariable('_backtoshop', $controllerId . $sPosition);

            // redirecting to basket
            $controllerId = 'basket?';
        }

        return $controllerId . $sPosition;
    }
726002
public function getLoginUrl()
    {
        // required params
        $params = array(
            'client_id' => $this->getClientId(),
            'redirect_uri' => $this->getRedirectUri(),
        );
        // optional params
        if ($this->getScope()) {
            $params['scope'] = implode(',', $this->getScope());
        }
        if ($this->getResponceType()) {
            $params['response_type'] = $this->getResponceType();
        }
        if ($this->apiVersion) {
            $params['v'] = $this->apiVersion;
        }
        if ($this->state) {
            $params['state'] = $this->state;
        }

        return 'https://oauth.vk.com/authorize?' . http_build_query($params);
    }
293630
public static function URI(){
    switch(true){
      case !empty($_SERVER['REQUEST_URI']):    $serv_uri = $_SERVER['REQUEST_URI']; break;
      case !empty($_SERVER['ORIG_PATH_INFO']): $serv_uri = $_SERVER['ORIG_PATH_INFO']; break;
      case !empty($_SERVER['PATH_INFO']):      $serv_uri = $_SERVER['PATH_INFO']; break;
      default:                                 $serv_uri = '/'; break;
    }
    $uri = rtrim(strtok($serv_uri,'?'),'/') ?: '/';
    return Filter::with('core.request.URI', $uri) ?: '/';
  }