Hello,
how can I get the client IPAddress/Hostname etc?
application.getIPAddress returns IP serverside
application.getHostName returns Servername
application.getOSName returns Server-OS
Additionally I tried the usermanager plugin with the same results:
var vClient = plugins.UserManager.Client();
vClient.ipAddress returns Server-IP
vClient.hostAddress returns Server-IP
vClient.hostName returns Servername;
vClient.osName returns Server-OS
Any ideas?
I guess this is webclient? Then it’s obvious, because your client runs on the server, so all calls to the Java virtual machine are made to the one of the server. To figure out these things in a client browser, you need to google a bit. External IP addresses can be resolved using external scripts and the navigator object offers quite some properties to narrow down operating system etc.
Yes it’s webclient.
Client informations like IP and timeZone are visible on the Servoy server-administration page so I don’t understand why Servoy has no functionality to readout important informations like that.
Anyway, i will create a workaround to get these informations.
I use the UserManager plugin to do exactly what you want. plugins.UserManager.Client().hostAddress should give you the client IP address of the current client as shown in the screenshot which is taken from a web client:
[attachment=0]IP Address.png[/attachment]
Hope this helps
Steve
That’s not correct, Steve.
Running webclient from WAN shows the application servers external IP, Hostname etc.
Definitely not how it is doing it on my server. I am using it to ensure each user logs on only once from any given IP address and the value I am getting for the HostAddress is definitely the same IP as Servoy is showing in the connected clients screen. The screenshot I posted is taken live from our running server (Centos 7) and the address shown for the UserManager IP address is the WAN address of the server and the one shown as the UserManager host address is that of my ADSL line. I am running Servoy 8.1.2 and UserManager version 2.1.10
The UserManager takes it from the same object as servoy-admin… So what you see on the client in servoy-admin is what you get from UserManager.
That’s strange because it’s different in my solution. Maybe because I use it in the frameworks authentication module?
Now I will try to hand it over to the authenticator solutionType with the authenticationObject. Maybe that’s the trick.
The authenticator is a solution that always runs server side… That’s the whole point about it ![Smile :)]()
I see.
Perfect, then my idea with passing the client informations as parameter to the authenticationObject should work. I’ll see it this evening after updating the server.