Returns the url to redirect the user to for user consent

def getLoginURL(self, redirect_url):
        """
        Returns the url to redirect the user to for user consent
        """
        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))