Why does security.login() always return false?

Here’s my authenticator solution code (not using Servoy tables for users etc).

I’ve read http://wiki.servoy.com/display/public/DOCS/Implementing+Security quite a few times!

function Authenticate(userName, password) 
{

	var ret = false;
	
	// -- Get hashed version of supplied plaintext password. 
	var hashedPassword = utils.stringMD5HashBase64(password);
	var sql = 'select user_name,user_password,user_pn_account,user_uid from users where user_name=?';
	var dataset = databaseManager.getDataSetByQuery('mydatabase', sql, [userName], 1);
	
	// -- Should be one only!
	if (dataset.getMaxRowIndex() == 1)
	{
		// -- Test password. Value is in row 1 col 2 etc as per Select above.
		var storedPassword = dataset.getValue(1, 2);
		var user_uid = dataset.getValue(1, 4);
		var user_name = dataset.getValue(1, 1).toString();
		
		if (storedPassword == hashedPassword)
		{
                         // -- These both return false.
			//ret = security.login(user_name, user_uid, ['administrators']);
			ret = security.login(user_name, user_name, ['administrators']);
			
		}
	}
	
	return ret;
	
}

and that authenticator solution you call from your client through the login solution?

are there any errors in your server log?

Also note that the groups are case-sensitive.
Are you sure that it’s not ‘Administrators’ instead of ‘administrators’.

ptalbot:
Also note that the groups are case-sensitive.
Are you sure that it’s not ‘Administrators’ instead of ‘administrators’.

Patrick, if we ever meet please kick me in the pants for missing the obvious.

Thanks