Gets the base url for all HTTP requests.

@param bool $withAuthentication If true, the authentification string will be appended. False otherwise
@return string
330773
protected function getBaseUrl($withAuthentication = false)
    {
        $config = $this->getConfig();
        $baseUrl = $config['scheme'] . '://' . rtrim($config['host'], '/') . '/';

        if (isset($config['path'])) {
            $baseUrl .= trim($config['path'], '/') . '/';
        }

        if ($withAuthentication === true
            && $this->getConnector()->getListener() instanceof \Buzz\Listener\BasicAuthListener) {

            $baseUrl .= 'a/';
        }

        return $baseUrl;
    }
1003135
public static function absoluteBaseURLWithAuth(HTTPRequest $request = null)
    {
        // Detect basic auth
        $user = $request->getHeader('PHP_AUTH_USER');
        if ($user) {
            $password = $request->getHeader('PHP_AUTH_PW');
            $login = sprintf("%s:%s@", $user, $password) ;
        } else {
            $login = '';
        }

        return Director::protocol($request) . $login . static::host($request) . Director::baseURL();
    }
1092628
public function getHostFull(bool $auth = false) : string
    {
        $out = (isset($this->uri['scheme']) ? $this->uri['scheme'] . '://' : '');

        if ($auth !== false && isset($this->uri['user'])) {
            $out .= $this->uri['user'] .
                (isset($this->uri['pass']) ? ':' . $this->uri['pass'] : '') . '@';
        }

        $out .= (isset($this->uri['host']) ? $this->uri['host'] : '') .
            (isset($this->uri['port']) ? ':' . $this->uri['port'] : '');

        return $out;
    }
1296094
public function getAllEndpoints($withHost = false, $forceReload = false)
    {
        $this->loadApiDefinition($forceReload);

        $host = empty($this->options['host']) ? '' : $this->options['host'];
        $prefix = self::PROXY_ROUTE;
        if (isset($this->options['prefix'])) {
            $prefix .= "/".$this->options['prefix'];
        }

        return !is_object($this->definition) ? [] : $this->definition->getEndpoints(
            $withHost,
            $prefix,
            $host,
            !empty($this->options['includeBasePath'])
        );
    }
609907
public function getPath($uri, array $params, $withQuery = true)
    {
        $cleanUrl = trim($this->getBaseUrl(), "/ ");
        $cleanUri = trim($uri, "/ ");

        if ($withQuery === false || empty($params))
            return sprintf("%s/%s", $this->getBaseUrl(), $cleanUri);

        // build HTTP query for GET request
        $query = http_build_query($params);
        return sprintf("/%s/%s?%s", $cleanUrl, $cleanUri, $query);
    }
1332804
public function getAuthorizationUrl($name, $redirectUrl = null, array $extraParameters = [])
    {
        return $this->helper->getAuthorizationUrl($name, $redirectUrl, $extraParameters);
    }
1077839
public function getAuthorizationEndpoint()
    {
        // Parse the endpoint.
        $parsedEndpoint = collect(parse_url($this->endpoint));

        // Return auth url.
        return $parsedEndpoint->get('scheme').'://'.$parsedEndpoint->get('host').'/authorization/api/';
    }
1105222
protected function defaultBaseAuthUrl()
    {
        $baseAuthUrl = [
            Yii::$app->controller->getRoute()
        ];
        $params = Yii::$app->getRequest()->getQueryParams();
        unset($params[$this->clientIdGetParamName]);
        $baseAuthUrl = array_merge($baseAuthUrl, $params);

        return $baseAuthUrl;
    }
1140927
public function getAuthorizeURL($token, $sign_in_with_twitter = true, $force_login = false)
	{
		if (is_array($token))
		{
			$token = $token['oauth_token'];
		}

		if ($force_login)
		{
			return $this->tconfig['AUTHENTICATE_URL'] . "?oauth_token={$token}&force_login=true";
		}
		else if (empty($sign_in_with_twitter))
		{
			return $this->tconfig['AUTHORIZE_URL']. "?oauth_token={$token}";
		}
		else
		{
			return $this->tconfig['AUTHENTICATE_URL'] . "?oauth_token={$token}";
		}
	}
539942
public function getName(bool $withExtension = true): string
    {
        if ($withExtension) {
            return pathinfo($this->path, PATHINFO_BASENAME);
        }

        return pathinfo($this->path, PATHINFO_FILENAME);
    }
182437
def get_authorization_url(self):
        """"""
        url = self._get_oauth_url('authenticate')
        query = {
            'client_id': self._client_id,
            'response_type': 'code',
            'redirect_uri': self.callback
        }
        query_str = self.urlencode(query)

        return url + '?' + query_str
380915
public function getAuthorizeUrl () {
		return sprintf('%s%s?%s', $this->host, $this->authorizePath, http_build_query([
			'response_type'			=> $this->code ?? static::RESPONSE_TYPE_CODE,
			'client_id'				=> $this->clientId,
			'redirect_uri'			=> $this->redirectUri,
			'scope'					=> implode(' ', (array) $this->scope),
			'state'					=> $this->state,
			'code_challenge'		=> $this->codeChallenge,
			'code_challenge_method'	=> $this->codeChallengeMethod ?? static::CODE_CHALLENGE_METHOD_SHA256,
		]));
	}
990578
public function baseUrl()
    {
        if (!$this->baseUrl) {
            $this->baseUrl = $this->request->getScheme()
                . '://' . $this->request->getHttpHost();
        }
        return $this->baseUrl;
    }
1024105
protected function getFederatedAuthenticationInformation($response) {
        if ($response) {
            $xml = new \DOMDocument();
            $xml->loadXML($response);
            $xpath = new \DOMXPath($xml);
            if ($xpath->query("//STSAuthURL")->length > 0) {
                return $xpath->query("//STSAuthURL")->item(0);
            }
        }
        return '';
    }
833695
public function getSignatureBaseString()
    {
        $parts = array(
            $this->getNormalizedHttpMethod(),
            $this->getNormalizedHttpUrl(),
            $this->getSignableParameters(),
        );
        
        $parts = OAuthUtil::urlencodeRfc3986($parts);
        
        return implode('&', $parts);
    }
1268207
public function getAuthenticationUrl($state = null, $forceVerify = false)
    {
        return implode('', [
            sprintf('%soauth2/authorize', $this->baseUri),
            '?response_type=code',
            sprintf('&client_id=%s', $this->getClientId()),
            sprintf('&redirect_uri=%s', $this->getRedirectUri()),
            sprintf('&scope=%s', implode('+', $this->getScope())),
            sprintf('&state=%s', $state),
            sprintf('&force_verify=%s', $forceVerify ? 'true' : 'false'),
        ]);
    }
1087963
public function getSignatureUrl()
    {
        return $this->getBaseUrl().str_replace(
            array_keys($this->getPathParameters()),
            array_values($this->getPathParameters()),
            $this->getPath()
        );
    }