def prepare_grant_uri(uri, client_id, response_type, redirect_uri=None,
                      scope=None, state=None, **kwargs):
    if not is_secure_transport(uri):
        raise InsecureTransportError()

    params = [(('response_type', response_type)),
              (('client_id', client_id))]

    if redirect_uri:
        params.append(('redirect_uri', redirect_uri))
    if scope:
        params.append(('scope', list_to_scope(scope)))
    if state:
        params.append(('state', state))

    for k in kwargs:
        if kwargs[k]:
            params.append((unicode_type(k), kwargs[k]))

    return add_params_to_uri(uri, params)
Prepare the authorization grant request URI.
dataset/ETHPy150Open idan/oauthlib/oauthlib/oauth2/rfc6749/parameters.py/prepare_grant_uri