• 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
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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: 11445
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: 11445
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: 11445
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
 
Marshal
Posts: 22458
121
Eclipse IDE Spring VI Editor 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic