开发者

Twitter API: OAuth vs. xAuth

1) Is it true that if you would like to have your custom dialogues to enter twitter user details that you cannot use OAuth to do that?

2) I looked at MGTwitterEngine and now I'm wondering whether it is really necessary to have more than 20 classes just to send a status update.

3) I used to use Basic Auth which worked just fin开发者_如何学编程e. It was very little code. Is there a way to modify that code so that it just works again?

Many thanks for your help.


You'll need to apply for xAuth from Twitter with a decent enough reason for them to allow you to use it. That will allow you to take the user's username & password using your own UI and get a token that way instead of going the web-route and directing them to a web auth page.

You'll most probably need to re-write a bunch of your basic auth methods to include all the OAuth signatures and headers into your requests. It'll be nice if they make the switch to OAuth 2 soon, it's much much easier.

I've written my own Twitter engine that uses XAuth and it's relatively simple (apart from the OAuth 1 garbage!). However it'll probably be best to use MGTwitterEngine if you're going the normal OAuth route. I'm not familiar with it but I hear good things. It depends on how you're going to use the API. Writing a simple wrapper probably won't be to hard if you're just interested in calling a few methods. It's just the OAuth 1 stuff that can get complicated; however Twitter's documentation on that is very good indeed.


If you only need to post to twitter, take a look at getsharekit.org it will save you a lot of the hassle with the integration

As for xAuth or oAuth if your application UI is heavily customised it can be well worthwhile applying for xAuth ,as your users all of a sudden will not come across twitters login pages, which are unlikely to be in keeping with the rest of your applications UI. However if your application is mainly a utility application, you will most likely be fine with the oAuth method which is easier as you do not need to apply to twitter for them to enable it

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜