Build redirect url for a given provider.
330520
def get_redirect_url(self, **kwargs):
        """"""
        provider_id = kwargs.get('provider', '')
        provider = self.get_provider(provider_id)
        if not provider:
            raise Http404('Unknown OAuth provider.')
        callback = self.get_callback_url(provider)
        params = self.get_additional_parameters(provider)
        return provider.get_redirect_url(self.request, callback=callback, parameters=params)
393186
def auth_url(self, scope):
        """"""
        params = {
            'response_type': 'code',
            'client_id': self.__client_id,
            'redirect_uri': self.__redirect_uri,
            'scope': scope
        }

        if self.__state is not None:
            params['state'] = self.__state

        return settings.AUTH_ENDPOINT + '/authorize?' + urllib.urlencode(params)
262615
def _build_url(self, host, handler):
        
        scheme = 'https' if self.use_https else 'http'
        return '%s://%s/%s' % (scheme, host, handler)
193736
def redirect_uris(self, value):
        """"""
        if isinstance(value, six.text_type):
            value = value.split("\n")

        value = [v.strip() for v in value]

        for v in value:
            validate_redirect_uri(v)

        self._redirect_uris = "\n".join(value) or ""
51304
def follow_redirects(url):
        
        opener = urllib2.build_opener(urllib2.HTTPRedirectHandler)
        return opener.open(url).url
887740
def build_url(self, path, params=None):
        '''
        
        '''
        url = u'%s/%s/productCode/%s' % (
            self.endpoint,
            path,
            self.product_code,
        )
        if params:
            for key, value in params.items():
                url = u'%s/%s/%s' % (url, key, value)

        return url
652834
def redirect_ext(to, params_=None, anchor_=None, permanent_=False, args=None, kwargs=None):
    
    if permanent_:
        redirect_class = HttpResponsePermanentRedirect
    else:
        redirect_class = HttpResponseRedirect
    return redirect_class(resolve_url_ext(to, params_, anchor_, args, kwargs))
328342
def get_redirect_target():
    """"""
    for target in request.values.get('next'), request.referrer:
        if target and is_local_url(target):
            return target
797048
def url_for(endpoint, default=DEFAULT_ENDPOINT, **values):
    

    try:
        return router.url_for(endpoint, force_external=True, values=values)
    except Exception:
        logger.warn("Could not build API URL for endpoint '%s'. "
                    "No route provider registered?" % endpoint)
        # build generic API URL
        return router.url_for(default, force_external=True, values=values)
354958
protected RedirectAction build(final CasClient casClient, final WebContext context, final boolean renew, final boolean gateway) {
        val serviceUrl = casClient.computeFinalCallbackUrl(context);
        val casServerLoginUrl = casClient.getConfiguration().getLoginUrl();
        val redirectionUrl = casServerLoginUrl + (casServerLoginUrl.contains("?") ? "&" : "?")
            + CasProtocolConstants.PARAMETER_SERVICE + '=' + EncodingUtils.urlEncode(serviceUrl)
            + (renew ? '&' + CasProtocolConstants.PARAMETER_RENEW + "=true" : StringUtils.EMPTY)
            + (gateway ? '&' + CasProtocolConstants.PARAMETER_GATEWAY + "=true" : StringUtils.EMPTY);
        LOGGER.debug("Final redirect url is [{}]", redirectionUrl);
        return RedirectAction.redirect(redirectionUrl);
    }
197526
def make_alias_redirect_url(self, path, endpoint, values, method, query_args):
        """"""
        url = self.build(endpoint, values, method, append_unknown=False,
                         force_external=True)
        if query_args:
            url += '?' + self.encode_query_args(query_args)
        assert url != path, 'detected invalid alias setting.  No canonical ' \
               'URL found'
        return url
595637
def get_login_redirect(self, provider, account):
        """"""
        info = self.model._meta.app_label, self.model._meta.model_name
        # inline import to prevent circular imports.
        from .admin import PRESERVED_FILTERS_SESSION_KEY
        preserved_filters = self.request.session.get(PRESERVED_FILTERS_SESSION_KEY, None)
        redirect_url = reverse('admin:%s_%s_changelist' % info)
        if preserved_filters:
            redirect_url = add_preserved_filters(
                {'preserved_filters': preserved_filters, 'opts': self.model._meta}, redirect_url)
        return redirect_url
99725
protected function buildUrl() {
		$this->url = $this->baseUrl . '?' . http_build_query(['secret' => $this->secretKey, 'response' => $this->response]);
	}
76114
def make_redirect_url(self, path_info, query_args=None, domain_part=None):
        
        suffix = ''
        if query_args:
            suffix = '?' + self.encode_query_args(query_args)
        return str('%s://%s/%s%s' % (
            self.url_scheme,
            self.get_host(domain_part),
            posixpath.join(self.script_name[:-1].lstrip('/'),
                           url_quote(path_info.lstrip('/'), self.map.charset,
                                     safe='/:|+')),
            suffix
        ))
179668
public function buildRedirect()
    {
        $merchantApi     = $this->buildMerchantApi();
        $settingsManager = new Shopgate_Helper_Redirect_SettingsManager(
            $this->config,
            $_GET,
            $_COOKIE
        );

        $templateParser = new Shopgate_Helper_Redirect_TemplateParser();

        $linkBuilder = new Shopgate_Helper_Redirect_LinkBuilder(
            $settingsManager,
            $templateParser
        );

        $tagsGenerator = new Shopgate_Helper_Redirect_TagsGenerator(
            $linkBuilder,
            $templateParser
        );

        $redirect = new ShopgateMobileRedirect(
            $this->config,
            $merchantApi,
            $tagsGenerator
        );

        return $redirect;
    }
886870
def authorization_link(self, redirect_uri):
        '''
        '''
        args = '?client_id=%s&redirect_uri=%s' % (
            self.app_key,
            redirect_uri
        )
        uri = "/".join([BASE_URL, API_VERSION, OAUTH, args])
        return uri
344841
def redirect(self, url):
        ''''''
        # TODO: Should we be overriding self.request with the new request?
        new_request = self._parse_request(url=url, handle=self.request.handle)
        log.debug('Redirecting %s to %s', self.request.path, new_request.path)
        return self._dispatch(new_request.path)