How to upgrade from Twitter BasicAuth to Oauth in my iPhone Application - iphone

I have struck with posting my application to apple because of following reason.
Application is not posting tweets to twitter. I have implemmented twitter with basic Auth. so that it is not working from August 31, 2010.
So can any one helpĀ me
How to upgrade from Twitter BasicAuth to Oauth in my iPhone Application.
Another question is:
This (Oauth) should not change the UI of my application. means when user clicks on twitter button it should ask user name and password every time, and if we click on send button it should send tweets to twitter.
i implemented the Oauth but it is asking the username and password one time.

I suggest you check out MGTwitterEngine on GitHub. This library wraps up the Twitter API nicely and does the OAuth stuff as well.
You don't need to ask you user for their username and password every time. You can get their credentials initially and then store the access token you get back from Twitter (or from MGTwitterEngine if you choose to use that library) and use that for next time.
MGTwitterEngine wraps up the access token with an OAToken object which does the persistence for you.

http://code.google.com/p/gtm-oauth/ is a drop-in OAuth implementation for iOS and Mac OS X

Related

Website and a facebook mobile app - do they need to be separate?

The existing website uses Facebook OAuth for login. The plan is that soon that certain events on the site will be posted to the user's timeline. The "userA watched xxx" kind of thing.
We're also at the stage of starting an iPhone app to connect to the website's data API. If the user has authenticated to the website with the mobile app using the facebook login:
would the mobile app need access to the Facebook oauth keys? I'm guess not, as the user would do something, and the website would have the credentials stored to post to facebook, but I'm not sure.
would there in fact be 2 apps, one that is facebook based and one that is not?
Apologies if this is really basic information I'm asking, but I've not developed Facebook apps previously and the information I look at isn't always clear.
In my apps, I code two authentication flows, one for facebook users, and one for users without facebook (this is the typical, create your account, and subsequently login with your username and password). So one app, two login flows.
Regarding the app accessing the Facebook oauth keys, if you are coding with the Facebook iOS SDK, you won't even need to worry about the oauth key itself, as it's totally encapsulated by the SDK. You'll simply invoke methods to trigger authentication, and then once the user is authenticated, you can call other methods to invoke certain aspects of SDK/API.
The Facebook iOS SDK supports all the functionality you'll need to make the posts directly from the app itself. You won't need to make an API call to your server, to then make a second call to the Facebook API. Just handle all that from the app directly. So if your app does depend on a successful API call to your server, prior to posting to Facebook, make that API call, wait for the response (that either includes additional data, or a success:true flag), and then make the post to the Facebook via the Facebook iOS SDK.
The Facebook iOS SDK docs are AWESOME these days, and the code samples are even better. Check them out at:
http://developers.facebook.com/ios/

Twitter iPhone- is it possible to post on twitter using iphone app without providing pin number

i am using oAuth method for login to twitter in iPhone application... it need two steps to allow me to post. first is username and password authentication after validating it, twitter provides pin number to authorize... then i copy or memorize and send to twitter for authorize me to post for each and every time i login to twitter.
is it possible to post to twitter without entering pin number or copy the pin number provided by twitter and send the token internally without copy or mermorizing...
Thanks and regards
venkat.
Yes, it is possible using xauth
You need to get approval to use xauth:
xAuth access is restricted to approved
applications. If your application is a
desktop or mobile application and the
standard web OAuth flow or PIN-code
out-of-band flow is not right for you,
send a detailed message to
api#twitter.com to request xAuth
privileges.

linkedin connectivity from my native iphone application

hello everyone i am new bie in iphone development i want to connect to linkedin from my native iphone application i am currently having no idea how to connect to it please guide me how could i do that
From http://www.zhangkf.com/2010/06/linkedin-developer-network-oauth-authentication/:
Yes you can get connected with Linedin withyour Native Application by
following simple steps:
You get an API key from LinkedIn. This is also called a Consumer Key in OAuth terminology.
You build a feature into your site that leverages the user's LinkedIn network.
Your user clicks on your UI to request to use that feature.
You make a call to LinkedIn to ask to use our authentication. This is called getting a Request Token.
LinkedIn replies with an OAuth Token indicating that you can use the authentication system.
You send your user to a LinkedIn URL. That URL includes the OAuth Token you got and a few other parameters such as a URL for LinkedIn to
return the user to after granting access.
The user grants access to your application by signing into that page.
Upon successful signon, LinkedIn will return the user to your site.
You will then make a call to LinkedIn to get an Access Token.
LinkedIn replies with an Access Token for the user. You use that Access Token for any API calls to LinkedIn to identify the user on
whose behalf you are making the call.
Or
Download the Code from here,you could get it.Just Provide your API Key and Secrete Key
http://github.com/ResultsDirect/LinkedIn-iPhone
Or see this for details:
http://developer.linkedin.com/docs/DOC-1008
This sample is 100% complete and working, just add your app key.
Built with the latest XCode 4.01.
Uses a UIWebView so you have the option of customizing the browser UI.
Uses JSON instead of XML, which is the preferred best practice for most cases
OAuth is heavily documented so you know what's happening
Tested with iPhone 4, iPad 1, and the simulator on iOS 4.x.
http://lee.hdgreetings.com/2011/03/iphone-oauth.html

Twitter OAuth for Iphone apps, twitbird

I am wondering if anyone has an idea on how did twitbird developers use oauth for allowing the user to authorize their app ?(they say that they did use OAuth)
when I was trying their app they used the username and password directly without redirection to twitter.
I searched for a solutions and there is no obvious answer because as far as I know OAuth doesnt allow the 3rd part applications to use the user's password..
Thanks in advance
Twitter has a new OAuth method called xAuth. It takes your username and password and does a one time exchange for OAuth access tokens which are then used for normal OAuth.
http://apiwiki.twitter.com/Twitter-REST-API-Method:-oauth-access_token-for-xAuth

Twitter REST change "from API" to something meaningful

When using simple request to post to Twitter the messages are signed with "sent from API". Is there a way to change that to the actual name of your application? Is it another post parameter or something else?
This is covered in the Twitter API FAQ
If you would like tweets from your application to recieve a source parameter, please register an application and implement OAuth authentication. We will automatically include your application as the source for any tweets sent from your application.
If you are writing a desktop Twitter client and you want your application's name to show up instead of "From API", you have to use OAUth.
If you want to use OAuth in your desktop Twitter application, you have to go through Twitter's PIN workflow (i.e., sending the user to the Twitter website to authenticate).
The confirmation step is part of the reason Twitter is using OAuth. There's no getting around it.
There are several libraries out there that implement OAuth for Twitter so you're not reinventing the wheel.
If you want example on how to use OAuth and Twitter I have it in my blog
"If you are writing a desktop Twitter client and you want your application's name to show up instead of "From API", you have to use OAUth.
If you want to use OAuth in your desktop Twitter application, you have to go through Twitter's PIN workflow (i.e., sending the user to the Twitter website to authenticate)."
Hold on a moment, how do Twitter clients manage to put their client name in the "via" without you logging in somewhere and copying a PIN back to the application.
I just want a command line client that updates my status and prints "via MyApp". Am I missing something here?
(I might be, I've only started trying to figure this out yesterday)
In fact if the user isn't authenticated, I don't want to get them to login elsewhere and copy/paste a PIN, I want them to type their user/pass into my application. Like what happens with all the twitter clients I've seen...