Using LDAP authenication through a java application based on already LDAP authenticated Windows Session?

So a user logs into a Windows Server 2008 SP2 (64 bit) through a domain using LDAP authentication.

I then have a Java application that launches. The application has several buttons to launch various other applications, which all use the same LDAP authentication (username/password) as used when the user came into the machine.

The problem (or more annoyance) is the user has to enter there username/password again when launching these apps (even though they already authenticated to windows). I'm wondering if there is a way in the JAVA code to use the current windows authentication to pass the users LDAP username and password into the API call that launches these apps? These apps all have an API I call that I pass in the username and password to authenticate, just currently I'm not passing anything in and letting the user enter it. It would be real nice if I could somehow pass in the LDAP details w/ out having to ask the user for them since they are already in windows.

NOTE: The user authenicated in windows will always be the same user launching to app.

Hopefully, what I'm asking makes sense. I'm not an expereienced windows admin or developer, if anything isn't clear or seems incorrect, just ask for clarification.
Who is Participating?
colr__Connect With a Mentor Commented:
Take a look at Spring security - single sign on with LDAP. What you are looking for was formerly called Acegi security (when I used it a couple fo years ago), which would allow you to log in to your app using your windows credentials via LDAP. I dont think it will be possible for you to actually obtain the credentials yourself though as this would be a security problem - no app should ever be given your windows credentials, however you could be smart about it and if the user logs in the first time and succeeds, store the credntials and associated them with the windows user. So the enxt time that user logs on to the machine, you can detect which user is logged in to windows, and extract your stored cache of credentials to use. You'd need to be SUPER careful with this though, you dont want to leak your windows user credentials!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.