security.getSystemUserName issue

Discuss all problems you have with Servoy here. It might help to mention the Servoy version and Operating System version you are using

security.getSystemUserName issue

Postby rafig » Thu Oct 31, 2013 5:26 pm

Hi
I am trying to use the 'security.getSystemUserName' function to pick up the client's (Windows) system user name to authenticate.
This works for me fine in Developer on both Mac & Windows, but when deployed on Smart Clients running on Windows with Java 6, the function returns 'system' for whoever logs in...

Is this some new sandbox or security issue with Java Web Start??

(BTW, this is in Servoy 5.2.6)

Thanks

Rafi
Servoy Certified Developer
Image
rafig
 
Posts: 708
Joined: Mon Dec 22, 2003 12:58 pm
Location: Watford, UK

Re: security.getSystemUserName issue

Postby rafig » Tue Nov 05, 2013 2:24 pm

Anyone??
(I'm bumping as I am at client tomorrow that I was working on this for...)

Rafi
Servoy Certified Developer
Image
rafig
 
Posts: 708
Joined: Mon Dec 22, 2003 12:58 pm
Location: Watford, UK

Re: security.getSystemUserName issue

Postby rafig » Wed Dec 11, 2013 6:14 pm

[BUMP!!!]

Please can anyone help me with this???
I have just managed to test with Servoy 5.2.16 & also 7.3.1 rc and the same thing happens, so it isn't a Servoy problem (I now assume, or if it is, then it is an issue all the way from 5.2.x to 7..3.x), but what is the point in this function if it's not going to give anything useful (in Windows)??

I'd (& my client) love to get this to work as it would really help with Servoy usage.

Thanks

Rafi
Servoy Certified Developer
Image
rafig
 
Posts: 708
Joined: Mon Dec 22, 2003 12:58 pm
Location: Watford, UK

Re: security.getSystemUserName issue

Postby Harjo » Wed Dec 11, 2013 6:36 pm

I don't know that function, but we do that with the it2be tools plugin!
Has worked ever since....
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: security.getSystemUserName issue

Postby rafig » Wed Dec 11, 2013 11:11 pm

Hi Harjo!
Harjo wrote:I don't know that function, but we do that with the it2be tools plugin!
Has worked ever since....

Thanks for the suggestion!
I did try it briefly, but it still seems to give the same username of 'system' back on Windows.
I needed to add some more 'debug' code in, but my copy of Servoy 5.2 got stuck on my Mac & then I had to leave client.
I will probably have to resume next week when I am there again.
Thanks
Rafi
Servoy Certified Developer
Image
rafig
 
Posts: 708
Joined: Mon Dec 22, 2003 12:58 pm
Location: Watford, UK

Re: security.getSystemUserName issue

Postby jcompagner » Thu Dec 12, 2013 10:46 am

it just asks for the system property user.name:

System.getProperty("user.name");

thats something the vm sets and gets from the os on startup.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: security.getSystemUserName issue

Postby rafig » Thu Dec 12, 2013 11:53 am

Ho Johan,
jcompagner wrote:it just asks for the system property user.name:

System.getProperty("user.name");

thats something the vm sets and gets from the os on startup.

I don't know about Java, but I know that when using developer, it works correctly, but then using client on Windows, any client, each with a different user name, returns the value 'system'.
Thanks

Rafi
Servoy Certified Developer
Image
rafig
 
Posts: 708
Joined: Mon Dec 22, 2003 12:58 pm
Location: Watford, UK

Re: security.getSystemUserName issue

Postby Harjo » Thu Dec 12, 2013 1:22 pm

Maybe at your customer, office, this is the case, but certainly not in our case.
We have a Saas solution, and use this already from Servoy 5 until Servoy 7, and still working perfectly.
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: security.getSystemUserName issue

Postby rafig » Fri Dec 20, 2013 12:59 pm

Hi Harjo,
Harjo wrote:Maybe at your customer, office, this is the case, but certainly not in our case.
We have a Saas solution, and use this already from Servoy 5 until Servoy 7, and still working perfectly.

thanks for your reply & sorry for not replying sooner, but I had not been back to client until today to try again.
It is still returning user 'system' for me here
I am using this code (with the old call commented out)
Code: Select all
   //globals.gsk_user = security.getSystemUserName ( ).toLowerCase ( );
   globals.gsk_user = plugins.it2be_tools.client ( ).userName.toLowerCase ( );
   application.output ( 'user ' + globals.gsk_user );

I don't know if I got this across, but I am trying to do this in an 'authenticator' module called from a 'login' module, using servoy.application_server.enhancedSecurity = true (Servoy version 5.2.16 -build 1029)
Is this data not available at that point, am I being stupid (probably ;-) ), I wish I knew what I am doing wrong 8-(
Thanks
Rafi
Servoy Certified Developer
Image
rafig
 
Posts: 708
Joined: Mon Dec 22, 2003 12:58 pm
Location: Watford, UK

Re: security.getSystemUserName issue

Postby rafig » Fri Dec 20, 2013 1:55 pm

[UPDATE]
Just investigating further.
It does seem that the username is returned differently when in 'authenticator' module than when in actual solution once started up...
I just added the same code into the main solution startup script and it returned the correct username (I added 'system' as a valid user to allow system to auto-login)
Will follow up shortly...
Rafi
Servoy Certified Developer
Image
rafig
 
Posts: 708
Joined: Mon Dec 22, 2003 12:58 pm
Location: Watford, UK

Re: security.getSystemUserName issue

Postby patrick » Fri Dec 20, 2013 2:41 pm

That is clear. The authenticator runs on the server, so you get the server processes user name. You will have to pass the user name from the login solution to the authenticator if you need it there.
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: security.getSystemUserName issue

Postby Harjo » Fri Dec 20, 2013 3:10 pm

:lol: yes ofcourse! the authenticator is running on the server, so it returns indeed the user that Servoy is running under.
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: security.getSystemUserName issue

Postby rafig » Fri Dec 20, 2013 4:33 pm

Hi Patrick!
patrick wrote:That is clear. The authenticator runs on the server, so you get the server processes user name. You will have to pass the user name from the login solution to the authenticator if you need it there.

Oh how I wish I'd know/realised/been told this earlier :lol:
That fixed it!
I pass the username from login to authenticator and it all works beautifully now.
Happy client :D

Thanks all
Happy Holidays to all.

Rafi

[BTW, this is using the correct Servoy call from topic heading, NOT the IT2Be plugin (although of course that would work)]
Servoy Certified Developer
Image
rafig
 
Posts: 708
Joined: Mon Dec 22, 2003 12:58 pm
Location: Watford, UK


Return to Discuss possible Issues and Bugs

Who is online

Users browsing this forum: No registered users and 13 guests

cron