def get_redirect_url(self, authorization_url, extra_params):
    params = {'appid': self.consumer_key, 'redirect_uri': self.callback_url, 'scope': self.scope, 'response_type': 'code'}
    if self.state:
        params['state'] = self.state
    params.update(extra_params)
    sorted_params = OrderedDict()
    for param in sorted(params):
        sorted_params[param] = params[param]
    return ('%s?%s' % (authorization_url, urlencode(sorted_params)))
def get_redirect_url(self, authorization_url, extra_params):
    params = {'appid': self.consumer_key, 'redirect_uri': self.callback_url, 'scope': self.scope, 'response_type': 'code'}
    if self.state:
        params['state'] = self.state
    params.update(extra_params)
    sorted_params = OrderedDict()
    for param in sorted(params):
        sorted_params[param] = params[param]
    return ('%s?%s' % (authorization_url, urlencode(sorted_params)))