Use built in Servoy security for webclient

Forum to discuss the Web client version of Servoy.

Use built in Servoy security for webclient

Postby wes.s.grayson » Fri Jul 10, 2020 12:25 am

I have an app that is accessed via Smart Client, but I would like to allow access to some users via the Webclient. I'm using custom security that gets the user's Windows user name and compares against a Users table. Since the webclient cannot determine the username, is there any way to use Servoy's built in user and groups when a user accesses via Webclient, but keep my Login\Authenticator for Smart Client users?

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";
       }    
   }      
wes.s.grayson
 
Posts: 46
Joined: Mon Jan 23, 2012 5:39 pm

Re: Use built in Servoy security for webclient

Postby mboegem » Tue Jul 14, 2020 4:54 pm

Why not just asking the user to enter their username?
You can still validate against users table.
If validation returned a positive result, you could store the username in cookie or local storage and use it the next time.
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image

Partner of Tower - The most powerful Git client for Mac and Windows
User avatar
mboegem
 
Posts: 1743
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam


Return to Servoy Web Client

Who is online

Users browsing this forum: No registered users and 3 guests

cron