I used System.getProperty("user.name") to get the userName of the user who logged in and started the application. It takes the login ID [windows username] of the user where the application is actually running.
But when a user opens a browser, and goes to my application, is there any way to get their network ID/login that they have used to log into their windows machine?
So that this helps to avoid a login screen and i can directly take the user to his home page without any authentication.
How does the user go to your application via the browser?
Usually, when you say application, it would indicate stand alone, whereas browser would indicate web based.
Do you mean a web version of your application when you say via the browser?
Yes, this is a web based intranet application. Actually the web application link will be posted in a general site.
And once this link is accessed by a user via their Windows machine, it should take the user's Windows login ID to the application.
From there, I could write logic to check with the backend and show the user ==> his home page directly.
Kindly help to get rid of this issue.
You can get the Principal object using HttpServletRequest's getUserPrincipal() method, but only if the web server / servlet container requires users to login. With Tomcat I've used JCIFS and its jcifs.http.NtlmHttpFilter to do this for me.