More Audit Trail/ security.login issue

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
}

Sammy,

I think it is wise to make this a support case in the support system (see issues and bugs) or send an email to Servoy Support when you are in need of direct help.

Hi all,

Just wanted to let you all know that I found a workaround to this problem. Hopefully, this may help others out there with the same problem.

Since we noticed that the audit trail will work the SECOND time you run the LDAP log in, basically, I just log in first time to solution1 but the script will then use the application.closeSolution(‘solution1’). Since it jumps back to the login screen without officially logging out, all the log in information is intact. After that, use an onshow script to automate the login the second time to the main menu. It’s kind of a wierd workaround, but i’m so happy to finally get LDAP with audit trail working. Thanks Marcel also for all your help and guidance! Feel free to contact me if you have the same issue. (this issue is still there even for Servoy 3.5rc1)

I am glad you were ‘sort of’ able to work around the issue.

Please make sure that this is really in the Servoy support system…