Security and personal login (newbie)

Hello,

I follow this the tutorial here http://www.servoy.com/docs/servoy_4/tutorials/servoy_4_securitySeriesHighRes/servoy_4_securitySeriesHighRes.html. I do exactly the same thing in my solution but it doesn’t work !

Here’s my code :

function btn_login()
{
var ok = security.login(globals.username, globals.password, new Array('users'))
	if (!ok){
	plugins.dialogs.showErrorDialog('Alors','Vérif','Accord');
}
}

If I use the “login control” inside Servoy it’s ok.

With the tutorial, if the password is wrong, no message, and the solution is open ! Same if the password is correct.

What I’m missing ?

Thank you for your kind help

security.login(globals.username, globals.password, new Array('users'))

this is not correct, see security.login example:

var groups = new Array()
groups[0] = 'Administrators'; //normally these groups are for example received from LDAP
var user_uid = globals.email; //also this id might be received from external authentication method
var ok =  security.login(globals.username, user_uid , groups)
if (!ok)
{
 	plugins.dialogs.showErrorDialog('Login failure',  'Already logged in? or no user_uid/groups specified?', '
}

so it is not the password that you send in but the user_uuid how servoy knows your users. (if users do have uuids)

the security login is for your users (in your datamodel) that map on the servoy user (through the uuid)
So that on both ends the same user is know.

Thank you for your answer.