For webclient, security.getSystemUserName() returns "System". So I've played around with this in the Login method but haven't had much luck. The webclient allows all users in regardless of username\password.
I'm trying to avoid using LDAP since I'm in a very large corporation and don't have the access to do that.
- Code: Select all
if (security.getSystemUserName()=="system")
{
if (security.authenticate(null,null,[userName, password]))
{
security.login(userName, userName, ['Administrators'])
return true;
}
else
{
errorMessage = "No tenant found. Please check your password";
}
}
else
{
if (security.authenticate("myAuthenticator","loginUser",[userName]))
{
return true;
}
else
{
errorMessage = "No tenant found. Please check your password";
}
}