Get username of client who connected to web server

后端 未结 5 2042
一整个雨季
一整个雨季 2021-02-15 11:25

Here\'s the scenario. I am code running on a web server in an AD domain. Some client has connected to me. How do I get that client\'s username, without having the client fill ou

5条回答
  •  北海茫月
    2021-02-15 12:13

    The latest way for Windows to do it is SPNEGO. To make it work fully you need you server to have an account in AD, and communicate with Kerberos. Then Spring Security, I was told, supports this.

    Now, not always you need to authorize users. Sometimes (e.g. for stats reasons) it's enough to get the AD id of the user. When I was playing with SPNEGO, the binary data that was passed from browser were including the user id in clear text. It can be extract from there, but cannot be trusted of course.

    NTLM is outdated, considered less secure, and largely rolled out from the environments.

提交回复
热议问题