title: How to use Windows login for single-sign-on and for Active Directory entries for Desktop Java application?
body: <p>I'd like to have my desktop Java application to have single sign on related to 
  Active Directory users. In two steps, I'd like to:</p>
  
  <ol>
  <li>Be sure that the particular user has logged in to Windows with some user entry.</li>
  <li>Check out some setup information for that user from the Active Directory</li>
  </ol>
  
  <p>With <a href="https://stackoverflow.com/questions/31394/java-programatic-way-to-determine-current-windows-user">Java: Programatic Way to Determine Current Windows User</a> I can get the name of the current Windows user but can I rely to that? I think the</p>
  
  <pre><code>System.getProperty("user.name")
  </code></pre>
  
  <p>won't be secure enough? ("user.name" seems to be got from environment variables, so I can't rely on that, I think?)</p>
  
  <p>Question <a href="https://stackoverflow.com/questions/390150/authenticating-against-active-directory-with-java-on-linux">Authenticating against Active Directory with Java on Linux</a>
  provides me the authentication for given name+pass but I'd like to authenticate based on the Windows logon?</p>
  
  <p>For the Active Directory access, LDAP would probably be the choice?</p>