• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Java - Getting Login ID

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

al ka wrote:


Please check your private messages for an important administrative matter
 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 22802
131
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
mooooooo ..... tiny ad ....
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic