How to identify the User

Forum to discuss the new web client version of Servoy.

How to identify the User

Postby marco.rossi » Wed Oct 24, 2018 7:02 pm

Hi,
on smartClient our users are logging in by using the windows/macOS username (single sign on).
We can do that because the smartClient runs on the client machine.

The problem with NGClient is that the client runs on server side so, the returned username/machine-name/MAC-address (etc.) are the same for all the users because
Servoy returns always the information related to the server machine.

Any idea on how is possible to identify the user on NGClient?

Thanks
Marco Rossi
Senior Analyst Developer
Freelance Consultant

IT Manager @Mantho
Webmaster @Sitoliquido
marco.rossi
 
Posts: 61
Joined: Sun Apr 12, 2015 9:33 pm

Re: How to identify the User

Postby mboegem » Thu Oct 25, 2018 9:55 am

Did a quick Google search for this.
It seem like Microsoft browsers can do this through some ActiveX function, but that is in no way cross-browser compatible.
All other replies to similar questions did return a negative answer.

Although not as nice, you could ask the user for his name the first time logon, then store this name in localStorage. Localstorage will be accessible the next time the user starts the application.
The localStorage is domain and user environment bound, so that should even save you when 2 users work on the same machine with the same browser in different profiles.
However if the user forces a clean browser-cache, the localStorage is gone and you should ask the user for his name again.

Hope this helps.
_____________________
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance SAN Developer

Image
User avatar
mboegem
 
Posts: 1449
Joined: Sun Oct 14, 2007 1:34 pm
Location: Hoofddorp, The Netherlands

Re: How to identify the User

Postby marco.rossi » Thu Oct 25, 2018 11:02 am

Hi Marc,
thank you for your reply.

Yes I saw the same on google but I'm trying to find the best solution that shall work over "any" browser (in fact, our users use any kind of browser)..
For
"localstorage"
you mean the method "application.setUserProperty" right? I'm already using it for others stuffs but it could serve at this case as well.

About
However if the user forces a clean browser-cache, the localStorage is gone and you should ask the user for his name again

Yes, I totally agree, this is the second reason because I opened this ticket: by using the previous listed solution (cookies) a clean browser-cache would
invalidate it.

For anyone who is reading this ticket: I tried also "it2be_tools" and "usermanager" (and any servoy application.* methods of course) plugins but they can't get any information about the client machine when
an NGClient is used.

Thank you again

Marco
Marco Rossi
Senior Analyst Developer
Freelance Consultant

IT Manager @Mantho
Webmaster @Sitoliquido
marco.rossi
 
Posts: 61
Joined: Sun Apr 12, 2015 9:33 pm

Re: How to identify the User

Postby rvanderburg » Thu Oct 25, 2018 11:10 am

You need a SSO backend to do something like that (like saml2)
Once the user is logged in into that (throught the browser) other browser applications can hook into that.
rvanderburg
Site Admin
 
Posts: 59
Joined: Wed May 04, 2011 10:28 am

Re: How to identify the User

Postby sean » Thu Oct 25, 2018 3:21 pm

Hi Marco,

In a browser, that is not possible (excepting ActiveX or other non-standard plugins) for security reasons.
You only get what is passed in the user agent string, which tells you anonymous info like OS and browser version.

As Ron says, you can get this from a 3rd-party provider (although it is not specifically the OS User name) but whatever you want from a backend system.
These 3rd-Party Identity Providers are the modern approach for web/cloud systems.

We just did a webinar recently on Servoy/Okta integration - one of the more popular/feature-rich ID Management Platforms.
Available here if you are interested.
Software Engineer
Servoy USA
sean
 
Posts: 114
Joined: Mon May 21, 2007 6:26 pm
Location: USA

Re: How to identify the User

Postby marco.rossi » Fri Oct 26, 2018 11:35 am

Thank you Ron and Sean for your answers.
I will propose your solutions to my client.

Meanwhile, I would like to try the solution proposed by Marc that seems to need less effort (and so, costs):
Marc, you talked about "localstorage" but: what do you mean exactly with that?

I tried to get what you suggested both using "application.setUserProperty" and "plugins.file.writeTxtFile" but the first seems to doesn't store any cookie (on the wiki it appears compatible with NGClient but seems to work more like the Headless client instead of Webclient: in fact when I restart the application I can't retrive any information by reading the previously stored property. The second question is: does "application.setUserProperty" work by running it within NGClient from Servoy Developer?) and the second stores the file where the user has set its download folder within the browser (sometime is the "download" folder and sometime the "desktop" folder and so on... I don't know where I have to retrive the saved file).

Thank you for your time

Marco
Marco Rossi
Senior Analyst Developer
Freelance Consultant

IT Manager @Mantho
Webmaster @Sitoliquido
marco.rossi
 
Posts: 61
Joined: Sun Apr 12, 2015 9:33 pm

Re: How to identify the User

Postby sean » Fri Oct 26, 2018 6:25 pm

Hi Marco,

For the NG client you might want to look at the webstorage extension. You can install it automatically using the Servoy Web Package Manager.
We did a webinar about it

Instead of cookies, this takes advantage of browser local storage.
Software Engineer
Servoy USA
sean
 
Posts: 114
Joined: Mon May 21, 2007 6:26 pm
Location: USA


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 1 guest