views:

869

answers:

1

How would I go about getting the Windows user credentials from a Swing application?

I am working on an internal (corporate) Swing application. Currently the user has to login to the application using a login screen, which then connects to an app server which authenticates the user against the company LDAP server.

Since the user has already logged in to his workstation using the same credentials, is there any way that a Swing application can get these credentials from Windows itself and then automatically log the user in (SSO)? I know this is possible because I have seen some other applications do it, but I don't know how to go about doing this with Swing/Java.

+2  A: 

There are similar questions on SO that look like interesting (so this question might be a duplicate):

IMHO, read carefully Kohsuke's blog posts (here and here) and the Single-Sign-On in Java Platform using Active Directory article, they contain very valuable informations.

But you need to dig the whole thing a bit further.

Pascal Thivent