简体   繁体   English

如何从Swing应用程序获取Windows登录凭据?

[英]How to get windows logon credentials from a Swing application?

How would I go about getting the Windows user credentials from a Swing application? 我如何从Swing应用程序获取Windows用户凭据?

I am working on an internal (corporate) Swing application. 我正在研究内部(公司)Swing应用程序。 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. 目前,用户必须使用登录屏幕登录应用程序,登录屏幕然后连接到应用服务器,该服务器根据公司LDAP服务器对用户进行身份验证。

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)? 由于用户已使用相同的凭据登录到他的工作站,因此Swing应用程序是否可以从Windows本身获取这些凭据,然后自动将用户登录到(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. 我知道这是可能的,因为我已经看到其他一些应用程序这样做,但我不知道如何使用Swing / Java来做这件事。

There are similar questions on SO that look like interesting (so this question might be a duplicate): 关于SO的类似问题看起来很有趣(所以这个问题可能是重复的):

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. 恕我直言,仔细阅读Kohsuke的博客文章( 此处此处 )和使用Active Directory的Java平台单点登录文章,它们包含非常有价值的信息。

But you need to dig the whole thing a bit further. 但是你需要进一步挖掘整个事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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