def handle_auth_verify(srfsh, args): ''' Verify auth w/ args ''' username = args[0] password = args[1] seed = srfsh.handle_request([ 'open-ils.auth', 'open-ils.auth.authenticate.init', '"%s"' % username ]) password = md5sum(seed + md5sum(password)) response = srfsh.handle_request([ 'open-ils.auth', 'open-ils.auth.authenticate.verify', osrf.json.to_json( { # handle_request accepts json-encoded params 'username' : username, 'password' : password, 'type' : args[2] if len(args) > 2 else None, } ) ])
def handle_login(srfsh, args): ''' Login w/ args ''' username = args[0] password = args[1] seed = srfsh.handle_request([ 'open-ils.auth', 'open-ils.auth.authenticate.init', '"%s"' % username ]) password = md5sum(seed + md5sum(password)) response = srfsh.handle_request([ 'open-ils.auth', 'open-ils.auth.authenticate.complete', osrf.json.to_json( { # handle_request accepts json-encoded params 'username' : username, 'password' : password, 'type' : args[2] if len(args) > 2 else None, 'workstation' : args[3] if len(args) > 3 else None } ) ])
def handle_login(srfsh, args): ''' Login w/ args ''' username = args[0] password = args[1] seed = srfsh.handle_request([ 'open-ils.auth', 'open-ils.auth.authenticate.init', '"%s"' % username ]) password = md5sum(seed + md5sum(password)) response = srfsh.handle_request([ 'open-ils.auth', 'open-ils.auth.authenticate.complete', osrf.json.to_json({ # handle_request accepts json-encoded params 'username': username, 'password': password, 'type': args[2] if len(args) > 2 else None, 'workstation': args[3] if len(args) > 3 else None }) ])