How to get username of currently logged user on client machine in Java?

前端 未结 3 844
春和景丽
春和景丽 2021-01-29 11:54

When the user (client) tries to get into the application by typing the URL, i need to get that machine\'s windows logged in username.

I have tried with System.get

相关标签:
3条回答
  • 2021-01-29 12:35

    For security purposes the amount of data applications running in a browser can access is limited. As far as I know, the only thing which is allowed access to client related data would be a Signed Applet.

    0 讨论(0)
  • 2021-01-29 12:42

    If this is for an intranet application, you can look at using NTLM (older) or Kerberos (newer) authentication (aka integrated windows authentication).

    If you're using Spring security, look at the kerberos extension, http://blog.springsource.org/2009/09/28/spring-security-kerberos/.

    0 讨论(0)
  • 2021-01-29 12:46

    Through java you will not be able to access it since it resides in server. You will have to use javascript to get it done...

    This might help you..

    Get Windows username with JavaScript?

    0 讨论(0)
提交回复
热议问题