Using Kerberos authentication for Server/Client application - c++

In c++ I am trying to build a portable server running on Linux and Windows and client running in Windows that will use MS Active Directory for authentication. After some research I decided that best way to go is use Kerberos. I decided to use MIT Kerberos v5 library due to BSD style licence.
But my problem is that I am completely unable to find good resource on working in Kerberos in C++. All examples that I found are just simple code snippets that fail to explain in enough details what input parameters to functions are and reference manuals (doxygen style) that briefly explains the function in question but does not provide enough information to understand the context where to use it.
In short, can you recommend good resource for C++ programmer that two weeks ago did not even know what Kerberos is?

The best place to start is the sample simple client and simple server in the MIT code distribution found here: https://github.com/krb5/krb5/tree/master/src/appl/sample
This shows you how to use GSSAPI to do mutual auth

I am not sure if you already have seen this, but the MIT Kerberos V5 API documentation looks pretty exhaustive.

Related

Web Services using C++

I am building a server-client application that involves heavy signal processing (e.g. FFT). I have a working application written in C++/Qt, where everything (signal processing and other calculations) is done in client and server just sends raw data. Now I feel it would be easier to implement these features on the server. So, that maintenance becomes easier.
As I am doing signal processing, I think I should stick to C++ for performance. But I am open to new ideas.
Constraints:
I need type checking so javascript is out of discussion.
Scaling includes adding more server and each server will have at the max
10-12 users. So, Hardware cost is important. I cannot use x number of
i7 processors.
No option of using cloud services.
So, right now my question is as follows:
How can I create web services using C++ for Linux server? (Although cross platform is not important, I would appreciate if I can achieve it.)
EDIT [02:09:2015]
Right now, I think the choice is between poco and C++ Rest SDK. I feel I should go for C++ Rest SDK. Mainly because it has only those features that I need. And Also it is supported by microsoft and uses boost internally. So, I feel in future, this might be well integreated with standard.
You could use cross-platform Poco library to implement HTTP server, it is really straightforward with this framework, and they have a lot of examples. You can also use JSON serialization (like rapidjson library) to implement REST service on top of HTTP - this way your Web service will be accesable by most of the modern Web frameworks.
You might want to take a look at the C++ Rest SDK, an open source, cross platform API from Microsoft.
Like #nogard suggested, I also recommend POCO for now. It's the most serious and feature-full solution. Given you mentioned Qt, I suggest you to take a look at Tufão.
EDIT:
I forgot to mention one comparison of mine on the C++ HTTP server frameworks.
If you directly handle HTTP requests, you might loose the functionality what Web Servers does well what it was build to do. I had a similar issue, what I did was wrap up my Qt c++ code inside a PHP extension. In your case you can do the same. Wrap your logic inside what ever technology you are about to use, doesn't matter it's PHP, net , Java or anything else.

Getting Started with Axis/C MIME/DIME and MTOM

I am about to start some work on Axis/C. I have a fair idea of C and webservices separately. I am also fairly ok with *nix.
Can someone tell me about the complexity related to creating a webservice with support for MIME/DIME and MTOM with Axis/C? The webservice will be invoked from Java as well as C++ clients.
Does Axis/C have any known limitations in this regard? What are the best starting points for learning Axis/C in general and MTOM et al. support in particular.
I would advise against Apache Axis/C or Axis2c for that matter. Both these projects lack active development and member contribution. Last Axis2c release was in 2009 and Axis/c release page link doesn't even work.
I have developed a reasonably complex web-services implementation (both client and server), and I have ran into these issues:
Documentation is just OK. Nothing great.
Returning status codes of your choice is not easy.
Some HTTP verbs have bugs - for example I couldn't get DELETE to work.
I have faced issues with the supplied XML library guththila. libxml worked better for me.
It's hard to build complex REST routes for your application.
Handling incoming XML objects is quite cumbersome and inconvenient. I ended up writing a library of convenience functions.
JSON support is missing.
Your application will tend to become large with each server-side service implementation running into at lease a hundred lines of code.
WSO2 seems to be another option as far as web-services in C is concerned. The Axis2C team is mostly full of WSO2 people anyways. I haven't tried it though, but definitely looks more promising than Axis2C.
I had to modify the code to get it axis 1 to compile on fedora 13 + I believe I had to add a pure virtual some where in the code

Create a IM program (like MSN or Gtalk ) using C++

My question is that create a IM software like MSN or Gtalk, to have the basic function using C++.
You can use any technology and libary to do that.
Can someone give me a suggestion?
I add that this not my homework. This
is my job question.
Because I am a fresh man in my
company.
So, they give me some questions to let
me dirty my hand.
My suggestion from experience with doing this sort of thing before is to find a library that implements Jabber also known as XMPP (Google Talk) for you. That way all you have to do is create the user interface. If you are working with Windows, MSDN has some great tutorials for creating user interfaces in C++. If you are using Linux, you will probably want to look for an X windows tutorial. Other than that, check out this link for a list of C++ libraries for Jabber/XMPP.
Good luck!
It sounds like you will probably want to use a library that already knows how to interface with existing IM clients. Google Talk, for example, uses the XMPP (also known as Jabber) protocol. The XMPP website has links to a number of free C++ libraries to communicate with other XMPP clients (like Google Talk):
http://xmpp.org/software/libraries.shtml
Here is one example of a GPL XMPP library for C++: http://camaya.net/gloox/

Developing a facebook app with c++

I'm a computer science student with experience in C/C++ and I want to have a go at developing
a simple facebook app. Can anyone recommend a good website and/or editor?
Is it doable with C++ or do I need to learn another language?
Thanks
I assume that you are talking about an internet application.
For the front end (client side), you will need something to enhance your web pages (in Javascript, for example). For the back end (server side), you will need to make database queries so you will need to know SQL as well.
No, I don't think C/C++ is enough.
I would suggest that you investigate some other languages such as PHP or ASP.Net.
It sure is doable in C++. I recommend though that you first write a small Facebook client API in a scripting language so you can do some quick and dirty testing while getting familiar with how the API works. This will save you a lot of frustration when trying to write the C++ version.
As editor I recommend Visual C++ Express Edition if you are using Windows, XCode if you are using Mac, and on Linux I'd use Vim (if that is your cup of tea).
A good website? The Facebook API docs pages of course!
i Released c++ facebook graph api client as open source
check it out here :
facebook-cpp-graph-api
Python might be worth considering.
The Wiki might not be a bad place to start on it.
(There are a couple of link to Tutorials in there)
Facebook Developers Wiki
check this c++ graph api as open source you can download it and use it
its handling login/authentication sequence with the Qwebkit:
http://code.google.com/p/facebook-cpp-graph-api/

What API to use for adding HTTP client support in an existing MFC app?

I have recently been given a task to add the ability to interact with Web Map Services to an existing MFC application and I am in need of a client-side HTTP API.
Based on my research, the leading candidates seem to be CAtlHttpClient and WinHTTP. I was curious to see if anyone had experiences they could share or opinions on which would be the better way to go (or suggestions for something else entirely).
At first glance, CAtlHttpClient seems to be a bit higher level and easier to use. However, in my research it seemed that any time people had a problem with not being able to do something with it, the answer was "use WinHTTP".
Result
I wound up using WinHTTP because WinInet displays dialog boxes and our application is usable through a COM API. I avoided Ultimate TCP/IP because I work for a large company and getting third party software approved for use in a product is a complete nightmare.
The simplest one is the WinInet MFC wrappers: CInternetSession and friends.
WinHTTP, although a different API, is built on the same model as WinInet yet provides better HTTP support (no FTP though but you probably don't care). Whether you need the extra goodies provided by WinHTTP should be examined.
A down side of WinHTTP is that ATL/MFC don't provide wrappers for it, as opposed to WinInet.
And as Rob mentioned, UltimateTCP is a excellent alternative. One of its advantages is that it's a library: you link the code into your application, thereby eliminating DLL hell potential problems. Also, it comes with full source code which might be convenient if you run into a limitation of the implementation.
Make your pick!
Try Ultimate TCP/IP available for free from here:
http://www.codeproject.com/KB/MFC/UltimateTCPIP.aspx
It's a very good library and very easy to integrate with your apps.