0
In my code I use System.getProperty("user.name") to get the local username. But I would like to use my application on a server. And by spinning it instead of returning what previously returned locally, it is returning "root".
I believe that it is returning the "username" of the server, or of my own machine but of the user Admnistrador. My question is: It is possible for me to get it even if I run the application from System.getProperty("user.name") to get it from the user you have accessing from the server?
If you’re not using System.getProperty(), there is some other way?
When running your application on a server, which username you want to return?
– Giuliano Griffante
The same that returns when I run on my machine. I am logged in with a network user, for example "R12345". I would like you to return this same user.
– Fillipe Sanches
Good,
System.getProperty()
, as the name already says, it will take the system, if you want to see the client name, you must make it authenticate or pass this name by parameter in the request to the server.– Giuliano Griffante