简体   繁体   中英

how to save mutiple values in raiseevent() python function

In pepper Robo, I would like to pass username and password as values in raiseEvent() method in python to validate user login details.

i have added below function in working project

sesson.raiseEvent("eventname", username, password)

    function login()
    {
             alert('reached login details');
             var username = document.getElementById('txtusername').value;
             var password = document.getElementById('txtpassword').value;
             //alert(username);
             //alert(password);
             loginDetails(username,password);

    }


    function loginDetails(username,password){

                session.raiseEvent("loginreq", username,password);
                //window.location = 'paybympay.html?Language='+ LANGUAGE;
    }

.raiseEvent() has to accept multiple values such as username and password

tested in pepper robot did not accept the multiple values. how to achieve this.

I'm assuming the code you're showing is javascript on Pepper's tablet.

1) What you're doing looks very insecure. I would strongly advise against passing any raw user password as a value in ALMemory, especially for what seems to be a payment system.

2) A slightly better way of doing this would be to directly call a service of your own, eg from javascript you can call MyServiceOnPepper.handleLogin(username, password), for example see the service-tabletpage example here for ways of doing that.

But I would not consider this secure enough for a user password, and would add encryption (for example, use RSA, and have your service publish a public key, and have the javascript use that to encrypt the password).

3) (it's also technically possible to pass a list as an ALMemory event, but using a dedicated service is cleaner and slightly more secure)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM