• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Identifying a user

 
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can someone tell me how I identify what user is logged on to windows??
Thanks for any help!
 
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See System.getProperties(), user.name in particular. Is that what you are after?
 
Jennifer Sohl
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes! Thank you very much!!
 
Jennifer Sohl
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there a similar one for the user's password that they are logged on with? I didn't see anything like this in the System API. Also, do you know where I could find some good examples of using the System.getProperties() method? I want to be able to take the user's windows logon and password and pass it to my JDBC connection.
Thanks again!
 
John Dale
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I doubt there is a way to get the login password in this manner. That would make for very insecure systems.
Someone in the JDBC forum may have found a way to get a JDBC connection under the current user's ID.
 
Jennifer Sohl
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That makes sense. Thanks for your help!
Have a nice day!
 
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jennifer Sohl:
That makes sense. Thanks for your help!
Have a nice day!


You may have to pop up an input message box to ask for their password for authentication to the database. You would probably want to do this anyways to ensure that the user is properly logged on, and that the user is actually the person that is logged on to Windows.
 
John Dale
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Typing system passwords into an application seems like a bad security practice. But for all I know, it is necessary.
If you do it, you may want to at least take care to see that it is not left around in memory, files, or in a system dump. You might get some ideas on this from the JavaDoc for javax.swing.JPasswordField and java.net.Authenticator.
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by John Dale:
Typing system passwords into an application seems like a bad security practice. But for all I know, it is necessary.
If you do it, you may want to at least take care to see that it is not left around in memory, files, or in a system dump. You might get some ideas on this from the JavaDoc for javax.swing.JPasswordField and java.net.Authenticator.


bad wording ( or misleading info ) by me. I did mean to pop up an input field ( JPasswordField ) to input the password info. Thanks for the clarification.
Jamie
 
reply
    Bookmark Topic Watch Topic
  • New Topic