简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM