简体   繁体   中英

Windows LDAP Authentication in C++

I am currently trying to authenticate users in a c++ application in Windows. I need to display a dialog for username and password and verify that they are an authenticated user on the Windows machine. Are there any libraries that allow for this functionality or a good way to go about it?

Probably CredUIPromptForWindowsCredentials (see http://msdn.microsoft.com/en-us/library/aa375178.aspx ) or old CredUIPromptForCredentials (see http://msdn.microsoft.com/en-us/library/aa375177.aspx ) could solve your problem?

UPDATED : Another the most old way to authenticate a user is using of SSPI. It will not help with displaying a dialog but this can you implement yourself. You can find a very old code example (probably the first one published by Microsoft) here http://support.microsoft.com/kb/180548 .

If you do want use LDAP API (see http://msdn.microsoft.com/en-us/library/aa366102.aspx ) you can use ldap_bind_s (see http://msdn.microsoft.com/en-us/library/aa366156.aspx ) to verify user authentication. See http://msdn.microsoft.com/en-us/library/aa366106.aspx as a code example (it is not exactly what you want, but you can understand how these API work)

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