def login(cookie_file_name, scheme, secret):
    tid = next_id()
    add_future(tid, {
        'arg': cookie_file_name,
        'action': lambda fname, params: on_login(fname, params),
    })
    return pb.ClientMsg(login=pb.ClientLogin(id=tid, scheme=scheme, secret=secret))
Exemple #2
0
def loginMsg(id, scheme, secret, uname=None, password=None):
    if secret == None and uname != None:
        if password == None:
            password = ''
        secret = str(uname) + ":" + str(password)
    onCompletion[str(id)] = lambda params: save_cookie(params)
    return pb.ClientMsg(login=pb.ClientLogin(id=str(id), scheme=scheme, secret=secret))
Exemple #3
0
def login(cookie_file_name, scheme, secret):
    tid = next_id()
    onCompletion[tid] = {
        'arg': cookie_file_name,
        'action': lambda fname, params: save_auth_cookie(fname, params),
    }
    return pb.ClientMsg(
        login=pb.ClientLogin(id=tid, scheme=scheme, secret=secret))
Exemple #4
0
def loginMsg(id, scheme, secret, cred, uname, password):
    if secret == None and uname != None:
        if password == None:
            password = ''
        secret = str(uname) + ":" + str(password)

    if secret != None:
        secret=secret.encode('utf-8')
    onCompletion[str(id)] = lambda params: save_cookie(params)
    return pb.ClientMsg(login=pb.ClientLogin(id=str(id), scheme=scheme,
        secret=secret, cred=parse_cred(cred)))