LDAP C++ API 选择 [英] LDAP c++ API choice

查看:28
本文介绍了LDAP C++ API 选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 Linux 下编写自己的 LDAP 客户端,特定于我们的本地环境.我很可能会使用 QT4 来提供一个闪亮的前端,而不会有太多麻烦.

I would like to write my own LDAP client under Linux, specific to our local environment. Most probably I will use QT4 to provide a shiny frontend without much hassle.

我发现似乎没有用于此的标准 C++ 库.OpenLDAP 提供了一个 C API,在某处也应该有一个 C++ API(实验性的?)..

I found that there seems to be no standard C++ library for this. OpenLDAP provides a C API and there should also be a C++ API (experimental?) somewhere..

我需要使用 C 的东西还是有值得推荐的 C++ API?

Do I need to use the C stuff or is there a C++ API out there worth of recommendation?

推荐答案

实际上,我已经为我的日常工作为 OpenLDAP 的 C API 编写了 C++ 包装器,但这并不是我最愉快的经历.

I've actually written a C++ wrapper for OpenLDAP's C API for my day job and it wasn't my most enjoyable experience.

我没有找到适合我的目的的 C++ 包装器(这是在 2006 年,所以事情可能已经改变了).我最终直接与 C api 交互,这并不可怕,但确实有一些奇怪之处.假设您使用 C/OpenLDAP 路线,我可以为您提供一些提示.

I didn't find a suitable C++ wrapper out there for my purposes (this was in 2006 so things may have changed since). I wound up directly interacting with the C api, which wasn't terrible but it does have some oddities. Assuming you go to the C/OpenLDAP route I can offer you a couple of tips.

我觉得有点奇怪,C API 定义在 RFC1823这意味着几乎每个库都有相同的 API.

Something that I found a little weird, the C API is defined in RFC1823 which means that pretty much every library has the same API.

然而,在 OpenLDAP 的情况下,一些 RFC1823 API 调用已被弃用,尤其是在身份验证部分.取决于谁分发了您的 OpenLDAP 库以及它是什么版本,将确定这些已弃用的功能是否已被禁用.

In the case of OpenLDAP however a number of the RFC1823 API calls have been deprecated, particularly around the authentication parts. Depending on who distributed your OpenLDAP library and what version it is will determine if these deprecated functions have been disabled.

避免弃用 API 的主要更改是从 ldap_init()ldap_open() 切换到 ldap_initialize() 并使用 ldap_sasl_bind()(混淆处理所有类型的身份验证)

The main changes to avoid the deprecated API are switching from ldap_init() and ldap_open() to ldap_initialize() and using ldap_sasl_bind() (which confusingly handles all types of auth)

这篇关于LDAP C++ API 选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆