Hi all. I’m really baffled here.
I’ve purchased the LDAP plugin from IT2BE in hopes we can just use LDAP to authenticate users to our solution. However, we’re running into a major roadblock using the security.login code to work with Audit Trail.
I’m able to get the LDAP to to authenticate to our LDAP server no problem. After the check happens, I need it to log in now to the servoy solution so the Audit trail will work. However, by using the code below, audit trail just would not work! The funny thing is, my “ok” variable would return true meaning that Servoy thinks the log in was successful. What’s MORE WIERD is that after logging in and having audit trail not work, if i go to TOOLS–>Security setting, then just click OK, the audit trail would magically turn on and the rest of the session would be logged. Please help!!! why is this happening? This really seems like a Servoy bug to me.
if (plugins.it2be_ldapclient.isAuthorized(connection2))
{
var username = globals.a_login_name; // this should be their full name
var userID = globals.a_login_name; // this is the windows login name
var groups = new Array();
var ldapName = globals.a_login_name;
if (ldapName == “szheng1” || ldapName == “mmcchesn”) {
username = “user1”
userID = security.getUserId(username)
groups[0] = ‘users’;
}
var ok = security.login(username, userID, groups); // “officially” logging in
if (!ok) {
plugins.dialogs.showErrorDialog(“Login failure”, “Invalid login???”, “OK”);
return
}