Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get windows logon credentials from a Swing application?

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.

like image 293
Ken Liu Avatar asked Sep 11 '09 20:09

Ken Liu


1 Answers

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

  • How do I access Windows credentials from Java?
  • Java Active Directory Integrated Windows Authentication

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.

like image 160
Pascal Thivent Avatar answered Sep 27 '22 22:09

Pascal Thivent