Authenticating users using Active Directory in Client-Server Application

前端 未结 1 2054
小鲜肉
小鲜肉 2020-12-01 08:25

I\'ve been asked to provide support for authenticating users against an Active Directory in our existing client server application.

At the moment a user supplies a

相关标签:
1条回答
  • 2020-12-01 09:02

    You do an NTLM/Kerberos/Negotiate SSPI exchange loop. There is a a full sample on MSDN for both the client and the server. To be clear: you do not use any sort of LDAP access explictily. Is the LSA (Local Security Authority) that talks with LDAP and establishes the identity of the client. If you are succesful in doing the entire SSPI loop, the authentication has succeeded already and the client identity is alread authenticated against the LDAP. If your server needs to know the client identity (eg. to know the use rname) it retrieves it from the security context resulted in the SSPI loop using the QueryContextAttributes(..., SECPKG_ATTR_NAMES,...) and retrieves the user name from the SecPkgContext_Names structure.

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