Generate authorize_url.

        >>> GitHub(client_id='3ebf94c5776d565bcf75').authorize_url()
        'https://github.com/login/oauth/authorize?client_id=3ebf94c5776d565bcf75'
962034
def authorize_url(self, state=None):
        '''
        
        '''
        if not self._client_id:
            raise ApiAuthError('No client id.')
        kw = dict(client_id=self._client_id)
        if self._redirect_uri:
            kw['redirect_uri'] = self._redirect_uri
        if self._scope:
            kw['scope'] = self._scope
        if state:
            kw['state'] = state
        return 'https://github.com/login/oauth/authorize?%s' % _encode_params(kw)
93942
function getAuthToken () {
  console.log('You have hit the rate limit for unauthenticated requests, please log in to raise your rate limit:\n'.red);

  program.prompt('GitHub Username: ', function (user) {

    console.log('\nAfter entering your password, hit return' + ' twice.\n'.green);
    var authProcess = spawn('curl', [
      '-u',
      user,
      '-d',
      '{"scopes":["repo"],"note":"mdlint"}',
      '-s',
      'https://api.github.com/authorizations'
    ], {
      stdio: [process.stdin, 'pipe', process.stderr]
    });

    authProcess.stdout.setEncoding('utf8');
    authProcess.stdout.on('data', function (data) {
      var response = JSON.parse(data);
      if (response.message) {
        console.log(response.message.red + '\n');
        process.exit();
      } else {
        fs.writeFileSync(tokenFile, response.token);
        console.log('Authenticated :). Now try your lint again. \n'.green);
        process.exit();
      }
    });
  });
}
828696
def get_authorization_url(self,
                              signin_with_twitter=False,
                              access_type=None):
        """"""
        try:
            if signin_with_twitter:
                url = self._get_oauth_url('authenticate')
                if access_type:
                    logging.warning(WARNING_MESSAGE)
            else:
                url = self._get_oauth_url('authorize')
            self.request_token = self._get_request_token(access_type=access_type)
            return self.oauth.authorization_url(url)
        except Exception as e:
            raise TweepError(e)
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)
235678
def access_token(self):
        
        access_token = generate_token(length=self.access_token_length[1])
        token_secret = generate_token(self.secret_length)
        client_key = request.oauth.client_key
        self.save_access_token(client_key, access_token,
            request.oauth.resource_owner_key, secret=token_secret)
        return urlencode([(u'oauth_token', access_token),
                          (u'oauth_token_secret', token_secret)])
385595
def authorize_url(provider, params=nil)
      connection.build_url(options[:authorize_url].sub(/:provider/, provider),
                           params).to_s
    end
405610
def app_authorization_url
      params = {
        response_type: "code",
        client_id: token_store.client_id,
        redirect_uri: redirect_uri,
        scope: scopes,
        state: state,
      }

      url = {
        host: gamewisp_url,
        path: authorize_path,
        query: URI.encode_www_form(params)
      }

      return URI::HTTPS.build(url)
    end
62461
def authorize_url(self):
        

        if self.oauth2_params and self.oauth2_params.get("display") == "mobile":
            auth_url = self.mobile_url + "authorize"
        else:
            auth_url = self.site_url + "authorize"

        params = {
            'client_id': self.client_id,
            'redirect_uri': self.redirect_url,
        }
        params.update(self.oauth2_params)

        params = filter_params(params)

        return "{auth_url}?{params}".format(auth_url=auth_url, params=urlencode(params))
1113524
def get_authorization_url(self):
        """"""
        return self._format_url(
            OAUTH2_ROOT + 'authorize',
            query = {
                'response_type': 'code',
                'client_id': self.client.get('client_id', ''),
                'redirect_uri': self.client.get('redirect_uri', '')
            })
635862
def authorize(self, client_id, redirect_uri, scope, 
                  state=None, user_name=None, user_email=None):
        
        query = [
            ('client_id', client_id),
            ('redirect_uri', redirect_uri),
            ('scope', scope)
        ]
        if user_name is not None:
            query.append(('user_name', user_name))
        if user_email is not None:
            query.append(('user_email', user_email))
        if state is not None:
            query.append(('state', state))
        return '%s/oauth2/authorize?%s' % (
            self._api.browser_endpoint, urllib.parse.urlencode(query))
519997
function generate_google_oauth2_url () {
  var access_type = (OPTIONS.access_type) ? OPTIONS.access_type : 'offline';
  var approval_prompt = (OPTIONS.approval_prompt) ? OPTIONS.approval_prompt : 'force';
  var url = oauth2_client.generateAuthUrl({
    access_type: access_type, // set to offline to force a refresh token
    approval_prompt: approval_prompt,
    scope: OPTIONS.scope // can be a space-delimited string or array of scopes
  });
  return url;
}
249403
def _remote_github_url_to_string(remote_url):
    """"""
    # TODO: make this work with https URLs
    match = re.search('git@github\.com:(.*)\.git', remote_url)
    if not match:
        raise EnvironmentError('Remote is not a valid github URL')
    identifier = match.group(1)
    return re.sub('\W', ':', identifier)
247297
def request_token(self):
        
        client_key = request.oauth.client_key
        realm = request.oauth.realm
        # TODO: fallback on default realm?
        callback = request.oauth.callback_uri
        request_token = generate_token(length=self.request_token_length[1])
        token_secret = generate_token(length=self.secret_length)
        self.save_request_token(client_key, request_token, callback,
            realm=realm, secret=token_secret)
        return urlencode([(u'oauth_token', request_token),
                          (u'oauth_token_secret', token_secret),
                          (u'oauth_callback_confirmed', u'true')])
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)
269345
function () {
      if (this.auth_url) {
        return this.auth_url;
      }
      var self = this,
        destination = {
          protocol: 'https',
          host: 'www.box.com',
          pathname: '/api/oauth2/authorize',
          search: querystring.stringify({
            response_type: 'code',
            client_id: self.client_id,
            state: self.csrf,
            redirect_uri: 'http://' + self.host + ':' + self.port + '/authorize?id=' + self.email
          })
        };

      self.auth_url = url.format(destination);
      return self.auth_url;
    }
519693
def client
      @client ||= ::OAuth2::Client.new(client_id, client_secret,
        {
          :site          => current_options.fetch(:site) { Github.site },
          :authorize_url => 'login/oauth/authorize',
          :token_url     => 'login/oauth/access_token',
          :ssl           => { :verify => false }
        }
      )
    end
1363213
def _github_store_authorization(cls, user, auth):
        
        ClHelper.run_command("git config --global github.token.{login} {token}".format(
            login=user.login, token=auth.token), log_secret=True)
        ClHelper.run_command("git config --global github.user.{login} {login}".format(
            login=user.login))