Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

oauth_callback on Android

I created a Twitter app I need user of my Android application to authorize its use. I'm at the point where I can call Twitter app page in the browser and successfully authorize. However, the callback seem not to be working, I end up with the confirmation message and PIN in the browser but my Android activity is never called (onResume is not triggered). Here's what I have

  1. Twitter URL: http://twitter.com/oauth/authorize?oauth_token=actualtokenhere&oauth_callback=myapp:///
  2. In my activity definition I have this intent-filter

            <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="myapp" />
        </intent-filter>
    
  3. As I stated - I get confirmation but not redirect so the Android app is never called back

like image 398
Bostone Avatar asked Jul 13 '09 18:07

Bostone


1 Answers

Well, turned out there was nothing wrong with my configuration. My twitter app simply had wrong setting for the "Application Type" If you have this problem - go to your app edit view on Twitter and check "browser" option for the "Application Type", then if authentication succeeds browser redirects to the callback URL. Now - I couldn't use Android-style callback URL (myapp://twitt) since that would not pass form validation. But turned out - you can enter anything that is valid URL there and provide the actuall callback URL in your code

like image 157
Bostone Avatar answered Sep 16 '22 12:09

Bostone