any available cross-platform LDAP client library? - c++

I wonder if there any available library which hides the OS-dependent LDAP client implementation details, like the idea for JDBC? and the library provides basic CRUD functionality also along with unified SSL API like what has been done in wldap32 in Windows.
Really appreciate!

Related

Authenticate linux client app to windows server app via kerberos or any secure protocol

I need some guides or keywords I can use for my additional research.
Assume there are client and server apps written in C++. There is a possibility to pass blobs from client to server and vise versa. On windows, we can introduce Kerberos utilization, generating, processing such blobs, accepting it, impersonating threads, etc. There are some examples on msdn. It's not so simple, but I've managed to make it work.
But what if my client runs on linux machine? The simplest and unsecured way of authentication is to pass username/domain/password of user in raw format via blobs. But if I want to use Kerberos? So, the questions are:
What preconditions do I need to have on client linux machine? My first thoughts were about some kind of samba/winbind things installed there. I heard samba authenticates to windows AD via Kerberos.
Is there any good examples of performing Kerberos handshake on linux? I know there are some examples on MIT website. Should I use these ones? I guess it's not so easy to make it work in a right way and test it (actually I KNOW it from my windows experience).
The API you should investigate is GSSAPI. If the windows server application uses SSPI ( the windows version of GSSAPI ) then you should be able to write an interoperable client using GSSAPI. It really depends on exactly how the windows server uses SSPI though. See MSDN SSPI for some details.
The MIT kerberos libraries are available with most linux distributions and have all the libraries you need to do GSSAPI with kerberos.
GSSAPI is a library for wrapping data, you still need to implement the resulting protocol exchange. Depending on exactly how the windows server is written this may be quite complex.
It is possible to use Active Directory as your KDC for writing linux client/server kerberos applications. Looking at the Linux Samba code should
help you understand some of the issues involved in writing a linux client
for windows based services.

How to implement Restful Webservice using C++

Are there any helpful c++ libraries which can support me, implementing a simple REST webservice?
I am not searching for a bloated webservice framework like c++ REST SDK, or something like that. I already have a HTTP server running which can handle HTTP calls. (especially the HTTP server from the poco libraries).
I guess it should be not too hard to implement a Restful webservice interface around that.
But my question is, do i have to implement it on my own (how would you implement it?) or can I still make use of some libraries? So I am searchin for a library that can actually help me processing rest requests.
kind regards

Supporting Web Services from a Win/MFC/C++ App

I am looking for the best way to add support for a REST based Web Service to an MFC C++ Application. This is legacy code that has been around a long time.
I need to have the Application provide the Web Service. I've researched this, and the articles are about consuming Web Services in a C++ App. I envision having to monitor a port and respond to the HTTP requests. It would probably make more sense to tie in with WCF and IIS, but I am not sure how to move forward.
I already have a tool of "making" this App into a Windows Service. I realize it would be better to have a "real" app, and this is what I have to work with. There is so much logic in this code and we are limited in development time, so we are taking the fastest approach possible. We also cannot use DCOM, as the Web Service will be called by a Linux based system.
Any suggested articles would be much appreciated.
For C++ you can test two libraries WSF/C and gSoap, another alternative is to develop it with C# and WCF , and communicate between C# and C++ using C++\CLI.
I use the Poco Net c++ library for this as it supports both HTTP client and server functionality. I considered various other libraries including Boost based stuff, but other than Poco I struggled to find everything I needed in one tidy package. It also has some easy to use mutex support which became essential for me as soon as I added a web server front-end to what had previously been a simple single threaded console app. Poco is cross platform but I mainly use it windows and it has served me well to date. I'm not very clued up on MFC so I don't know how it would get on in that department though.

swig, soap or restful for my c/c++ library

I have a library/API that is completely built with C/C++ for over 10 years (under Linux). Now I want to export the API as a web service for other web projects use. I search for the web and narrow down to the following 3 chooses:
use SWIG to export the API to PHP or other script/web base language
use gSOAP to export the API as SOAP protocol
export the API as RESTful service (I can't find any exist framework, any suggestions?)
I want to compare them in terms of
stability
easy of use
performance
SWIG seems easy to use buy I am not sure the stability of it.
gSOAP seems very stable but a bit difficult to use and setup.
Any suggestion?
I personally used WSO2-WSF-CPP which is a C++ layer on top of AXIS2/2 to export legacy C++ code as web-service.
I tried back then gSOAP which worked quite well, but for stability and deployment reasons I choose WSO2, since AXIS2/C can be deployed easily as a module of the well know Apache2 HTTP server.
For the ease of use requirement I don't know if you plan to take WSDL file as a template to generate source code skeleton, but you can forget about this feature of the WSO2 package ... It seems to have been deprecated for a long time and the generated code is way too ugly to be maintained by hand.
Although doing a code generator yourself could be a good idea depending on the complexity and the amount of services you have. I recommend it! I did that and creating/building/generating services is quite straightforward now.
Another thing to notice about the WSO2 web services is that it's simple to build out of the box, and comes with stand-alone server to develop and test with. It was quite helpful (even if I am quite sure any decent web-service platform provides this kind of stuff like gSOAP does).

Perform a simple HTTP request using C++ / Boost via a proxy?

I'm quite a newbie with Boost, and my only experience of surfing though a proxy using a library is using .NET (that is really convenient for that purpose). I'm now trying to perform a simple HTTP request through a HTTP proxy.
Is there a tidy way to do it using boost directly?
My proxy use a NTLM authentification.
No, Boost provides neither an HTTP client nor a way to interface with proxies. You would necessarily have to implement those features yourself.
To be clear, yes, it is possible to implement an HTTP client using Boost.Asio. But implementing a client that can reliably talk through a proxy is significantly more complex, and Asio does not provide any support for that beyond the low-level socket itself. It certainly does not include the framework for performing NTLM authentication, which may prove difficult to get right.
More complex libraries like cURL provide that support.