Giter Site home page Giter Site logo

Comments (2)

pipacs avatar pipacs commented on July 19, 2024

Hi, I don't know much about Windows or Sina Weibo, but here are my O2 related answers

~ Akos.

On Feb 6, 2013, at 14:04, SSSANTON [email protected] wrote:

After reading the lastest README doucument you just uploaded,I still can't use this library to make an Open Platform Client(Sina weibo, like facebook) through oauth2 authorization which based on desktop(win7) enviorment.Is that this library not support in desktop application?

According to my poor knowledge about network and HTTP methods.I learnt that the o2reply is use for deal with the QNetworkreply queue.And the o2replyserver is use for handle the data from the TCP socket.At last,the o2requestor is for GET or POST with the token to use the API.But what make me painful is how all these stuff works in a project.I really want to know is the procedure of the the library(very hopeful).

They are all very similar to their O1 equivalents which is demonstrated in the example Twitter app in the README.

1.Why it use the TCP instead of the QNetworkReply for processing the Authorization Reply?

Because O2ReplyServer is a complete web server. That's how you write network servers in Qt.

(1)What is the purpose of O2::LINK?

This is the method that initiates logging in. So when the user presses the login button for example, you should call this method

(2)Why the RediretUrl is http://localhost:%1/").arg(replyServer_->serverPort()?Can I change it which I had setted on callbackURL setting of the platform I used?

That's a default URL which works for most OAuth providers. You can have a custom one, if Sina Weibo requires it. See the Skydrive customization for example in o2skydrive.cpp.

(3)It that right once the SIGNAL openBrowser(url) is emited,the newconnection from QTCP will be emitted?It's that means that we open the brwoser(Qurl) just for get response from the TCP port and have a TCP newconnecttion?If is is not?And how to active the SIGNAL newconnection?

There is one point in the authentication sequence when the user has to enter name, password, possibly other credentials, authorise your application to access his account etc.

All these need a web UI which you must provide by opening a browser window with the given URL. But the rest of the interaction will be taken care by the service provider.

(4).All the problems troubles me,because it is impossible to get the "CODE" with for acces the TOKEN. without sloving these problem.And could you please give me some advice for getting the CODE from the firt step of the oauth2.0 protocol.

The O2 library will take care of all these. Once the authentication sequence has completed (when you get the linkingSucceeded signal), CODE and TOKEN will be available in the your O2 object instance, in the "code" and "token" properties.

And you don't even need to deal with code and token yourself, if you are using the O2 library for creating authenticated requests, using O2Requestor and O2Reply.

O2Requestor is like QNetworkAccessManager, but instead of sending plain network requests, it creates and sends authenticated requests.

O2Reply is like QNetworkReply, plus it handles network timeouts and expired tokens.

Anyway,no matter you answer all these problems or no,still thanks for share such wonderful oauth2.0 library based on QT,cause such properties is extremly less.And all these problems may only for one reason------I am a typical noob~~~ orz


Reply to this email directly or view it on GitHub.

from o2.

SSSANTON avatar SSSANTON commented on July 19, 2024

Hi! My friend Akos:
In these days,I still working on it and I tried to modify some part of your code,using the QWebView signal(Urlchanged) to get the CODE and the following step is use the QScriptEngine to get the ACCESS_TOKEN.After finishing the oauth2 authorization,I finally managed to update the status in the sina weibo platform!!!

I can't overcome the problems and keep my patience without your generous help! So I have to thank you again!
Best wishes!! ^ ^

from o2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.