Comments, Code and Qt. Some words about the wonderful world of software engineering

kQOAuth – OAuth library for Qt

kQOAuth is now at D-Pointer!

You will be automatically redirected in 5 seconds...

  • slvr32

    … This is done by opening the user’s web browser…

    I’m not sure I’d call kQOauth a library, considering that overhead :/

    • http://www.johanpaul.com/blog/ Johan Paul

      I am sure you do understand that
      - OAuth 1.0 requires the user authentication to be done with a web browser and
      - You do not need to use this feature of the library if you don’t want. You can use kQOAuth just for request signing and sending and do the user authentication yourself however you want to do it.

      ?

      Or did I misunderstand your comment?

      • slvr32

        Sorry, I just caught the web browser detail with a quick glance, and thanks for the follow-up. I just ran across QOAuth the other day, but the kQOAuth news item @ maemo.org was the first I’d heard of kQOAuth, and I’m curious about QOAuth vs kQOauth differences.

        • http://www.johanpaul.com/blog/ Johan Paul

          About QOAuth I can tell you that I needed an OAuth library in Qt for my own project and looked at QOAuth. But there were some reasons I wanted to improve on it so I wrote my own lib. Anyone is free to judge by himself, but I think kQOAuth is more Qt-like and also kQOAuth uses signals-slots to be async. I also added the convenience APIs so it should be really easy to use the lib.

          Last but not least, QOAuth has a dependency to QCA project (which is a big library) and kQOAuth does not have any external dependencies.

  • Sam

    Hey

    It doesn’t compile for Symbian in Nokia Qt SDK. I keep getting error when i open root pro file and hit build.
    :: error: No rule to make target `NokiaQtSDKSymbianSDKepoc32releasearmv5LIBkqoauth.dso’, needed by `NokiaQtSDKSymbianSDKepoc32releasegcceudebtwittercli.exe’. Stop.

    Can you fix this please?

    • http://www.johanpaul.com/blog/ Johan Paul

      I am sorry, but I can’t. I don’t have experience in Symbian, nor a device to test with or even interest in Symbian. So I haven’t included any Symbian specific build rules (whatever may be needed).

      If you know how to fix this, I am more than happy to include a patch.

      • Sam

        I was able to compile it statically inside my application, but not as a library like it was ment to be in your .pro file. Didn’t test it on the device yet though :)

        • http://www.johanpaul.com/blog/ Johan Paul

          For Symbian? Cool!!

          Please share the results how it works on the device :)

        • Sam

          I will try tonight! btw. any estimate when can we expect support for GET requests also?

        • http://www.johanpaul.com/blog/ Johan Paul

          Real soon now :) I just need to get it done… not a big deal. Any suggestions on a service that uses GET requests so I can test this?

        • Sam

          I would need GET requests for HeiaHeia http://apiwiki.heiaheia.com/doku.php?id=apimethods , i dont know other services but im sure others using GET also exists.

        • http://www.johanpaul.com/blog/ Johan Paul

          Nice, thanks. Follow me on Twitter @kypeli and I will let you know when GET support is there. Hopefully tonight. Then you can tell me if it worked :)

        • Sam

          It works on symbian, at least i am able to get request tokens…Didnt try to make other requests yet.

        • Sam

          Did you test if the GET request actually works?:) I cant get it to work :(

        • http://www.johanpaul.com/blog/ Johan Paul

          I did test against an OAuth 1.0 test server at http://term.ie/oauth/example/ and it did echo back correctly the GET parameters I sent it. You can see the functional test and what I do at http://gitorious.org/kqoauth/kqoauth/blobs/master/tests/ft_kqoauth/ft_kqoauth.cpp#line250.

          But no, I didn’t test against any “real” service like HeiaHeia. Maybe I should do that at some point too.

        • Sam

          I dont know why but the GET request fails always and i get “Invalid OAuth request” reply. I sniffed the traffic with wireshark and for me it shows like it tries to pass oauth_callback for authenticated requests also? I thought its needed only for authorization. I might have done something wrong of course.Another difference between your test and my code getting the sports list from HeiaHeia is that you add those parameters? I dont have to add any parameters for request to heiaheia when i want to get sports list like it says on the api: http://apiwiki.heiaheia.com/doku.php?id=getsports

          Otherwise the library is very good! Much better than qoauth or oauth c library.. :) Thank you!

        • http://www.johanpaul.com/blog/ Johan Paul

          Thank you for your kind words! :)

          I would like to sort out your problem, but I would prefer doing it over email. So you could please send me your email address for example as a direct message on Twitter where you can find me as Kypeli. I will get back to you.

        • Sam

          i sent you message on IRC at freenode :)

        • http://www.johanpaul.com/blog/ Johan Paul

          …but looking at HeiaHeia Wiki and thinking of it, kQOAuth should provide an API to return the raw data the service replies with. So if I got it right, HeiaHeia replies with XML data, which kQOAuth really doesn’t handle right now.

          So expect a fix soon and some API that will get you the raw service data that is sent as the GET request reply from the service. I will announce it on Twitter when it’s done (if nobody is faster and wants to contribute ;) )

        • http://www.johanpaul.com/blog/ Johan Paul

          Ok, I did some changed:

          - requestReady() signal now contains the raw server response as sent from the server. New signature is: requestReady(QByteArray). The signal is emitted after each request is done.

          Please let me know if this solved your issue.

  • http://www.johanpaul.com/blog/ Johan Paul

    I’ve added support for GET requests as well. You do them as before with POST requests, but specify the type of the request to be KQOAuthRequest::GET.

    Please also note that I refactored how service specific additional parameters are given;
    - Now both POST and GET requests use the same interface to specify the additional parameters for the request: through request->setAdditionalParameters(params)
    - setRequestBody() was removed as obsolete.