Returns a URL representation of this request, appending the client ID and scopes to the original authUrl.
973830
String toUrl(Auth.UrlCodex urlCodex) {
        return new StringBuilder(authUrl)
                .append(authUrl.contains("?") ? "&" : "?")
                .append("client_id").append("=").append(urlCodex.encode(clientId))
                .append("&").append("response_type").append("=").append("token")
                .append("&").append("scope").append("=").append(scopesToString(urlCodex))
                .toString();
    }
902366
def get_authorize_url(self, **params):
        '''
        
        '''
        params = self.session_obj.sign(self.authorize_url,
                                       self.app_id,
                                       self.app_secret,
                                       **params)
        return self.authorize_url + '?' + params
1018030
def client_tokens(self):
        
        client_id, client_secret = self.get_auth_basic()
        if not client_id and not client_secret:
            client_id = self.query_kwargs.get('client_id', '')
            client_secret = self.query_kwargs.get('client_secret', '')
            if not client_id and not client_secret:
                client_id = self.body_kwargs.get('client_id', '')
                client_secret = self.body_kwargs.get('client_secret', '')

        return client_id, client_secret
763136
def getLoginURL(self, redirect_url):
        
        p = Properties()
        p.master = self.master
        clientId = yield p.render(self.clientId)
        oauth_params = {'redirect_uri': self.loginUri,
                        'client_id': clientId, 'response_type': 'code'}
        if redirect_url is not None:
            oauth_params['state'] = urlencode(dict(redirect=redirect_url))
        oauth_params.update(self.authUriAdditionalParams)
        sorted_oauth_params = sorted(oauth_params.items(), key=lambda val: val[0])
        return "%s?%s" % (self.authUri, urlencode(sorted_oauth_params))
459530
def get(self, request):
        ''''''
        ul = Html('ul')
        for router in sorted(self.routes, key=lambda r: r.creation_count):
            a = router.link(escape(router.route.path))
            a.addClass(router.name)
            for method in METHODS:
                if router.getparam(method):
                    a.addClass(method)
            li = Html('li', a, ' %s' % router.getparam('title', ''))
            ul.append(li)
        title = 'Pulsar'
        html = request.html_document
        html.head.title = title
        html.head.links.append('httpbin.css')
        html.head.links.append('favicon.ico', rel="icon", type='image/x-icon')
        html.head.scripts.append('httpbin.js')
        ul = ul.to_string(request)
        templ = asset('template.html')
        body = templ % (title, JAPANESE, CHINESE, version, pyversion, ul)
        html.body.append(body)
        return html.http_response(request)
1144421
def callback_oauth2(self, request):
        
        callback_url = self.callback_url(request)

        oauth = OAuth2Session(client_id=self.consumer_key, redirect_uri=callback_url, scope=self.scope)
        request_token = oauth.fetch_token(self.REQ_TOKEN,
                                          code=request.GET.get('code', ''),
                                          authorization_response=callback_url,
                                          client_secret=self.consumer_secret,
                                          scope=self.scope,
                                          verify=False)
        return request_token.get('access_token')
772399
function request(req) {
        var clientID = getParam(req, 'client_id')
            , redirectURI = getParam(req, 'redirect_uri')
            , scope = getParam(req, 'scope')
            , state = getParam(req, 'state');

        if (!clientID) {
            throw new AuthorizationError('Missing required parameter: client_id', 'invalid_request');
        }

        if (scope) {
            for (var i = 0, len = separators.length; i < len; i++) {
                var separated = scope.split(separators[i]);
                // only separate on the first matching separator.  this allows for a sort
                // of separator "priority" (ie, favor spaces then fallback to commas)
                if (separated.length > 1) {
                    scope = separated;
                    break;
                }
            }

            if (!Array.isArray(scope)) {
                scope = [scope];
            }
        }

        return {
            clientID: clientID,
            redirectURI: redirectURI,
            scope: scope,
            state: state
        };
    }
745401
def authentication_url(self):
        """"""
        params = {
            'client_id': self.client_id,
            'response_type': self.type,
            'redirect_uri': self.callback_url
        }
        return AUTHENTICATION_URL + "?" + urlencode(params)
882464
def authentication_url_from_master(master_url, auth_params)
      client = Kontena::Client.new(master_url)
      vspinner "Sending authentication request to receive an authorization URL" do
        response = client.request(
          http_method: :get,
          path: authentication_path(auth_params),
          expects: [501, 400, 302, 403],
          auth: false
        )

        if client.last_response.status == 302
          client.last_response.headers['Location']
        elsif response.kind_of?(Hash)
          exit_with_error [response['error'], response['error_description']].compact.join(' : ')
        elsif response.kind_of?(String) && response.length > 1
          exit_with_error response
        else
          exit_with_error "Invalid response to authentication request : HTTP#{client.last_response.status} #{client.last_response.body if debug?}"
        end
      end
    end
1282446
def get(self, request, *_args, **_kwargs):
        

        access_token = self.access_token

        scope_string = request.GET.get('scope')
        scope_request = scope_string.split() if scope_string else None

        claims_string = request.GET.get('claims')
        claims_request = json.loads(claims_string) if claims_string else None

        if not provider.scope.check(constants.OPEN_ID_SCOPE, access_token.scope):
            return self._bad_request('Missing openid scope.')

        try:
            claims = self.userinfo_claims(access_token, scope_request, claims_request)
        except ValueError, exception:
            return self._bad_request(str(exception))

        # TODO: Encode and sign responses if requested.

        response = JsonResponse(claims)

        return response
425313
def get_auth_url(self, app_id, canvas_url, perms=None, **kwargs):
        """"""
        url = "{0}{1}/{2}".format(
            FACEBOOK_WWW_URL, self.version, FACEBOOK_OAUTH_DIALOG_PATH
        )

        args = {"client_id": app_id, "redirect_uri": canvas_url}
        if perms:
            args["scope"] = ",".join(perms)
        args.update(kwargs)
        return url + urlencode(args)
292305
def oauth_query
      {
        client_id:     client_id,
        scope:         scope,
        response_type: "code",
        redirect_uri:  redirect_uri
      }.map do |key, val|
        "#{CGI.escape(key.to_s)}=#{CGI.escape(val.to_s)}"
      end.join(?&)
    end
202675
def _build_auth_request(self, verify=False, **kwargs):
        
        json = {
            'domain': self.domain
        }
        
        credential = self.credential
        params = {}
        
        if credential.provider_name.startswith('lms'):
            params = dict(
                login=credential._login,
                pwd=credential._pwd)
        else:
            json.update(authenticationkey=credential._api_key)
        
        if kwargs:
            json.update(**kwargs)
            self._extra_args.update(**kwargs) # Store in case we need to rebuild later
        
        request = dict(
            url=self.credential.get_provider_entry_point(self.url, self.api_version),
            json=json,
            params=params,
            headers={'content-type': 'application/json'},
            verify=verify)
        
        return request
673444
public function getAuthenticationUrl()
    {
        $params = [
            'client_id' => $this->clientId,
            'scope' => $this->scopes,
            'state' => $this->state,
            'response_type' => 'code',
            'redirect_uri' => $this->redirectUrl,
        ];

        return 'https://medium.com/m/oauth/authorize?' . http_build_query($params);
    }
946765
def setup_oauth_client(self, url=None):
        
        if url and "://" in url:
            server, endpoint = self._deconstruct_url(url)
        else:
            server = self.client.server

        if server not in self._server_cache:
            self._add_client(server)

        if server == self.client.server:
            self.oauth = OAuth1(
                client_key=self.store["client-key"],
                client_secret=self.store["client-secret"],
                resource_owner_key=self.store["oauth-access-token"],
                resource_owner_secret=self.store["oauth-access-secret"],
            )
            return self.oauth
        else:
            return OAuth1(
                client_key=self._server_cache[server].key,
                client_secret=self._server_cache[server].secret,
            )
707907
public String authenticationUrl(String redirect, String scope) {
        return authenticationUrl(redirect, scope, null);
    }
561022
def get_client(self, client_id):
        ''''''
        client_response = self.get_request('clients/%s' % client_id)
        return Client(self, client_response['client'])