

def generate_authorize_url(self, redirect_uri='urn:ietf:wg:oauth:2.0:oob', response_type='code', access_type='offline', approval_prompt='auto', **kwargs):
    "Returns a URI to redirect to the provider.\n\n    Args:\n      redirect_uri: Either the string 'urn:ietf:wg:oauth:2.0:oob' for a\n                    non-web-based application, or a URI that handles the\n                    callback from the authorization server.\n      response_type: Either the string 'code' for server-side or native\n                     application, or the string 'token' for client-side\n                     application.\n      access_type: Either the string 'offline' to request a refresh token or\n                   'online'.\n      approval_prompt: Either the string 'auto' to let the OAuth mechanism\n                       determine if the approval page is needed or 'force'\n                       if the approval prompt is desired in all cases.\n\n    If redirect_uri is 'urn:ietf:wg:oauth:2.0:oob' then pass in the\n    generated verification code to get_access_token,\n    otherwise pass in the query parameters received\n    at the callback uri to get_access_token.\n    If the response_type is 'token', no need to call\n    get_access_token as the API will return it within\n    the query parameters received at the callback:\n      oauth2_token.access_token = YOUR_ACCESS_TOKEN\n    "
    self.redirect_uri = redirect_uri
    query = {
        'response_type': response_type,
        'client_id': self.client_id,
        'redirect_uri': redirect_uri,
        'scope': self.scope,
        'approval_prompt': approval_prompt,
        'access_type': access_type,
    }
    query.update(kwargs)
    parts = list(urlparse.urlparse(self.auth_uri))
    query.update(dict(parse_qsl(parts[4])))
    parts[4] = urllib.urlencode(query)
    return urlparse.urlunparse(parts)

dataset/ETHPy150Open acil-bwh/SlicerCIP/Scripted/attic/PicasaSnap/gdata/gauth.py OAuth2Token.generate_authorize_url/original