Search code examples
iostwitteroauthsharekit

Session timeout error with Twitter OAuth flow using ShareKit on iOS


I am using ShareKit to allow the user of an iPad application to Tweet a URL from within the application through their Twitter account. The following OAuth steps work fine:

  1. ShareKit uses the Consumer Key and Consumer Secret hard-coded in the app to request the URL to load in a WebView.
  2. The URL provided by Twitter displays correctly in the WebView.
  3. The user is prompted to grant Read and Write permissions by logging into their Twitter account using the WebView.
  4. The WebView shows a redirecting page briefly while it redirects to the callback URL.

At this stage in the OAuth flow things go wrong.

After the WebView displays a Twitter 'redirecting' message very briefly, a page saying 'Your session has timed out' is displayed.

I decided to create a Twitter application in my own personal Twitter account. When I change the app to use my own Consumer Key and Consumer Secret (but keeping the callback URL and permissions the same), everything works fine.

I have cross checked the Consumer Key and Secret with the values in the app and they match (for the Twitter account that failed).

I used Twurl and everything worked fine with both Twitter accounts. So I don't understand what could be wrong with only one of the Twitter accounts and only when using ShareKit.

I could do with some direction on how to track down the problem?


Solution

  • I can not help you directly but original share kit is obsolete in many ways. You might want to try ShareKit 2.0. At least, on ios5+ it uses Twitter.framework, so your problems might be gone.