• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java - Getting Login ID

 
alamelu vel
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Please help!
 
Maneesh Godbole
Saloon Keeper
Posts: 11096
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
al ka wrote:

Please check your private messages for an important administrative matter
 
Maneesh Godbole
Saloon Keeper
Posts: 11096
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
alamelu vel
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Maneesh Godbole
Saloon Keeper
Posts: 11096
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
 
Rob Spoor
Sheriff
Pie
Posts: 20613
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic