Appropriate Callback URL for web app?


#1

I’m having difficulty getting the full OAuth handshake to operate for a registered app. The app is set with Read-Write access. I’ve reviewed the troubleshooting suggestions at https://dev.twitter.com/discussions/204

When I set the Callback URL setting to either an empty string or some placeholder value, I receive the following request/response pair on request_token (https://api.twitter.com/oauth/request_token) - note synced timestamps; obfuscated key & signature; using the v2.0.21 of LinqToTwitter library.

Any clues as to what might be happening?

REQUEST

Authorization: OAuth oauth_callback=“http%3A%2F%2Flocalhost%3A3733%2FLinqToTwitterWebFormsDemo%2Fdefault.aspx”,oauth_consumer_key="0**Q",oauth_nonce=“3831000”,oauth_signature_method=“HMAC-SHA1”,oauth_timestamp=“1315974215”,oauth_version=“1.0”,oauth_signature="5%3D"
LocalDate: 9/14/2011 4:23:35 AM
Host: api.twitter.com

RESPONSE

Status: 401 Unauthorized
X-Transaction: 1315974408-93987-28162
X-Frame-Options: SAMEORIGIN
Pragma: no-cache
X-Content-Type-Options: nosniff
X-Revision: DEV
X-MID: 9150783fc3e6eeddc598fddf2f02df8fb67d3d9b
Content-Length: 178
Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
Content-Type: text/html; charset=utf-8
Date: Wed, 14 Sep 2011 04:26:48 GMT
Expires: Tue, 31 Mar 1981 05:00:00 GMT
Last-Modified: Wed, 14 Sep 2011 04:26:48 GMT
Set-Cookie: k=98.240.211.26.1315974408837750; path=/; expires=Wed, 21-Sep-11 04:26:48 GMT; domain=.twitter.com,guest_id=v1%3A131597440884643076; domain=.twitter.com; path=/; expires=Fri, 13 Sep 2013 16:26:48 GMT,_twitter_sess=BAh7CDoHaWQiJTg3YTA5NGFkMDg5MzliNjc2YzkxNzZlNzE2MTllZGZjIgpm%250AbGFzaElDOidBY3Rpb25Db250cm9sbGVyOjpGbGFzaDo6Rmxhc2hIYXNoewAG%250AOgpAdXNlZHsAOg9jcmVhdGVkX2F0bCsIj%252BovZjIB–7cb6eaefdf925847cb90cb77f60baa39a0eeaa40; domain=.twitter.com; path=/; HttpOnly
Server: hi
WWW-Authenticate: OAuth realm="http://api.twitter.com"
Vary: Accept-Encoding
Connection: close

<?xml version="1.0" encoding="UTF-8"?> Desktop applications only support the oauth_callback value 'oob' /oauth/request_token

#2

Update: issue resolved after setting the app’s Callback URL to some non-empty string, waiting a while, and then re-issuing the request.


#3

hi, I have an application web with jsp and use the jar twitter4j-core-2.2.5.jar
and with a public I.P works well, but localhost does not work,
the sample error is:
connect timed outRelevant discussions can be on the Internet at:
http://www.google.co.jp/search?q=10f5ada3 or
http://www.google.co.jp/search?q=dceba048
TwitterException{exceptionCode=[10f5ada3-dceba048 10f5ada3-dceba01e], statusCode=-1, retryAfter=-1, rateLimitStatus=null, featureSpecificRateLimitStatus=null, version=2.2.5}

can anyone help please


#4

@DexJobTweets i am having same error.well i am passing ‘oob’ in CALLBACK_URL.
06-26 12:47:22.565: W/KeyCharacterMap(1137): No keyboard for id 0
06-26 12:47:22.565: W/KeyCharacterMap(1137): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
06-26 12:47:23.785: W/System.err(1137): api.twitter.comRelevant discussions can be on the Internet at:
06-26 12:47:23.785: W/System.err(1137): http://www.google.co.jp/search?q=10f5ada3 or
06-26 12:47:23.785: W/System.err(1137): http://www.google.co.jp/search?q=d4636531
06-26 12:47:23.795: W/System.err(1137): TwitterException{exceptionCode=[10f5ada3-d4636531 10f5ada3-d4636507], statusCode=-1, retryAfter=-1, rateLimitStatus=null, featureSpecificRateLimitStatus=null, version=2.2.3}
06-26 12:47:23.795: W/System.err(1137): at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:204)
06-26 12:47:23.795: W/System.err(1137): at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:65)
06-26 12:47:23.795: W/System.err(1137): at twitter4j.internal.http.HttpClientWrapper.post(HttpClientWrapper.java:102)
06-26 12:47:23.795: W/System.err(1137): at twitter4j.auth.OAuthAuthorization.getOAuthRequestToken(OAuthAuthorization.java:121)
06-26 12:47:23.795: W/System.err(1137): at twitter4j.auth.OAuthAuthorization.getOAuthRequestToken(OAuthAuthorization.java:104)
06-26 12:47:23.795: W/System.err(1137): at twitter4j.TwitterBaseImpl.getOAuthRequestToken(TwitterBaseImpl.java:271)
06-26 12:47:23.795: W/System.err(1137): at promact.android.twitty.LoginActivity.onClick(LoginActivity.java:180)
06-26 12:47:23.807: W/System.err(1137): at android.view.View.performClick(View.java:2485)
06-26 12:47:23.807: W/System.err(1137): at android.view.View.onKeyUp(View.java:4257)
06-26 12:47:23.807: W/System.err(1137): at android.widget.TextView.onKeyUp(TextView.java:4500)
06-26 12:47:23.807: W/System.err(1137): at android.view.KeyEvent.dispatch(KeyEvent.java:1280)
06-26 12:47:23.807: W/System.err(1137): at android.view.View.dispatchKeyEvent(View.java:3855)
06-26 12:47:23.807: W/System.err(1137): at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:789)
06-26 12:47:23.825: W/System.err(1137): at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:789)
06-26 12:47:23.825: W/System.err(1137): at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:789)
06-26 12:47:23.825: W/System.err(1137): at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:789)
06-26 12:47:23.825: W/System.err(1137): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:1687)
06-26 12:47:23.825: W/System.err(1137): at com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1120)
06-26 12:47:23.835: W/System.err(1137): at android.app.Activity.dispatchKeyEvent(Activity.java:2073)
06-26 12:47:23.835: W/System.err(1137): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1663)
06-26 12:47:23.835: W/System.err(1137): at android.view.ViewRoot.deliverKeyEventToViewHierarchy(ViewRoot.java:2560)
06-26 12:47:23.835: W/System.err(1137): at android.view.ViewRoot.handleFinishedEvent(ViewRoot.java:2535)
06-26 12:47:23.835: W/System.err(1137): at android.view.ViewRoot.handleMessage(ViewRoot.java:1867)
06-26 12:47:23.845: W/System.err(1137): at android.os.Handler.dispatchMessage(Handler.java:99)
06-26 12:47:23.845: W/System.err(1137): at android.os.Looper.loop(Looper.java:123)
06-26 12:47:23.865: W/System.err(1137): at android.app.ActivityThread.main(ActivityThread.java:3683)
06-26 12:47:23.865: W/System.err(1137): at java.lang.reflect.Method.invokeNative(Native Method)
06-26 12:47:23.865: W/System.err(1137): at java.lang.reflect.Method.invoke(Method.java:507)
06-26 12:47:23.865: W/System.err(1137): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-26 12:47:23.865: W/System.err(1137): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-26 12:47:23.865: W/System.err(1137): at dalvik.system.NativeStart.main(Native Method)
06-26 12:47:23.865: W/System.err(1137): Caused by: java.net.UnknownHostException: api.twitter.com
06-26 12:47:23.865: W/System.err(1137): at java.net.InetAddress.lookupHostByName(InetAddress.java:506)
06-26 12:47:23.885: W/System.err(1137): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:294)
06-26 12:47:23.885: W/System.err(1137): at java.net.InetAddress.getAllByName(InetAddress.java:256)
06-26 12:47:23.885: W/System.err(1137): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.(HttpConnection.java:69)
06-26 12:47:23.885: W/System.err(1137): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.(HttpConnection.java:48)
06-26 12:47:23.885: W/System.err(1137): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection$Address.connect(HttpConnection.java:322)
06-26 12:47:23.885: W/System.err(1137): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(HttpConnectionPool.java:89)
06-26 12:47:23.895: W/System.err(1137): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHttpConnection(HttpURLConnectionImpl.java:285)
06-26 12:47:23.895: W/System.err(1137): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.makeConnection(HttpURLConnectionImpl.java:267)
06-26 12:47:23.895: W/System.err(1137): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:205)
06-26 12:47:23.895: W/System.err(1137): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:614)
06-26 12:47:23.895: W/System.err(1137): at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:162)
06-26 12:47:23.905: W/System.err(1137): … 30 more
06-26 12:47:23.905: D/AndroidRuntime(1137): Shutting down VM
06-26 12:47:23.905: W/dalvikvm(1137): threadid=1: thread exiting with uncaught exception (group=0x40015560)


#5

Appropriate Callback URL for android app?