aspose file tools
The moose likes Java in General and the fly likes  Java - Getting Login ID Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark " Java - Getting Login ID " Watch " Java - Getting Login ID " New topic
Author

Java - Getting Login ID

alamelu vel
Greenhorn

Joined: Apr 27, 2010
Posts: 2
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

Joined: Jul 26, 2007
Posts: 8441

al ka wrote:

Please check your private messages for an important administrative matter


[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 8441

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

Joined: Apr 27, 2010
Posts: 2
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

Joined: Jul 26, 2007
Posts: 8441

I was about to reply, when I found that you have cross posted your question http://www.java-forums.org/advanced-java/28235-java-getting-login-id.html
Please read http://faq.javaranch.com/java/BeForthrightWhenCrossPostingToOtherSites
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

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.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Java - Getting Login ID
 
Similar Threads
NT authentication in Java/JSP
NT authentication
getUserpricipal()
How to read client m/c windows login id through JavaScript.
Navigation problem