jpurcell / birdhouse

BirdHouse is a Titanium Developer plugin for authenticating and sending API calls to Twitter.
64 stars 17 forks source link

Authorization problem : fn-get_access_token #8

Open Umair opened 13 years ago

Umair commented 13 years ago

I tried at Titanium 1.6.2 and 1.7.0 , But while getting access token it shows exception , you can check the log

[DEBUG] [16,70821] fn-get_request_verifier: response was AYTeMXzKsghoSWf8EBCjIQZLVjRBKv7Px9YU8IzeQ [INFO] [35,70856] verifier : AYTeMXzKsghoSWf8EBCjIQZLVjRBKv7Px9YU8IzeQ [INFO] [2,70858] loading1: undefined [INFO] [16,70874] loading2: undefined [DEBUG] [111,70985] fn-get_access_token [DEBUG] [5,70990] fn-api: callback sent is "org.appcelerator.titanium.kroll.KrollCallback@43f739b8" [DEBUG] [73,71063] fn-api: force authorization is false [INFO] [2,71065] ----- Initializing API Request Sequence123 ----- [DEBUG] [285,71350] access_token is typof: string [DEBUG] [176,71526] fn-api: accessor is {"tokenSecret":"","consumerSecret":"19R5zoHd4ss6pjXLWudft2WLXYaqihRqGrLDxy9udw"} [TRACE] D/dalvikvm( 354): GC_FOR_MALLOC freed 10803 objects / 782280 bytes in 119ms [TRACE] D/NativeCrypto( 354): Freeing OpenSSL session [TRACE] D/NativeCrypto( 354): Freeing OpenSSL session [TRACE] D/dalvikvm( 354): GC_FOR_MALLOC freed 10084 objects / 691216 bytes in 102ms [TRACE] D/dalvikvm( 354): GC_FOR_MALLOC freed 8757 objects / 614168 bytes in 102ms [DEBUG] [3552,75078] the API request message: {"action":"https:\/\/api.twitter.com\/oauth\/access_token","method":"POST","parameters":[["oauth_token","jvSOnoJG4YyBCfPLBY5UXKiXskGJoFXNSqeeB8"],["oauth_verifier","AYTeMXzKsghoSWf8EBCjIQZLVjRBKv7Px9YU8IzeQ"],["oauth_consumer_key","I2l0Ko4cBWuO4k5PInrgA"],["oauth_signature_method","HMAC-SHA1"],["oauth_timestamp","1306820563"],["oauth_nonce","gPxiTuMhMPlmzoa8kOOMfMzzIgxfhG47AVzOauuEOM"],["oauth_version","1.0"],["oauth_signature","RDmgUcZd9IGZag0aFlhUdXrYqxs="]]} [DEBUG] [44,75122] api url: https://api.twitter.com/oauth/access_token?oauth_token=jvSOnoJG4YyBCfPLBY5UXKiXskGJoFXNSqeeB8&oauth_verifier=AYTeMXzKsghoSWf8EBCjIQZLVjRBKv7Px9YU8IzeQ&oauth_consumer_key=I2l0Ko4cBWuO4k5PInrgA&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1306820563&oauth_nonce=gPxiTuMhMPlmzoa8kOOMfMzzIgxfhG47AVzOauuEOM&oauth_version=1.0&oauth_signature=RDmgUcZd9IGZag0aFlhUdXrYqxs%3D [TRACE] D/TiHttpClient( 354): (kroll$3: app://twitter/login.js) [13,75135] Setting ready state to 1 [TRACE] I/TiHttpClient( 354): (kroll$3: app://twitter/login.js) [1,75136] Twitter: not sending X-Requested-With header [TRACE] D/dalvikvm( 354): GC_FOR_MALLOC freed 7426 objects / 693072 bytes in 103ms [TRACE] D/NativeCrypto( 354): Freeing OpenSSL session [TRACE] D/TiHttpClient( 354): (TiHttpClient-3) [1896,77032] Setting ready state to 2 [TRACE] D/TiHttpClient( 354): (TiHttpClient-3) [2,77034] Setting ready state to 3 [TRACE] D/TiHttpClient( 354): (TiHttpClient-3) [3,77037] Setting ready state to 4 [TRACE] W/MessageQueue( 354): Handler{43ef1640} sending message to a Handler on a dead thread [TRACE] W/MessageQueue( 354): java.lang.RuntimeException: Handler{43ef1640} sending message to a Handler on a dead thread [TRACE] W/MessageQueue( 354): at android.os.MessageQueue.enqueueMessage(MessageQueue.java:179) [TRACE] W/MessageQueue( 354): at android.os.Handler.sendMessageAtTime(Handler.java:457) [TRACE] W/MessageQueue( 354): at android.os.Handler.sendMessageDelayed(Handler.java:430) [TRACE] W/MessageQueue( 354): at android.os.Handler.post(Handler.java:248) [TRACE] W/MessageQueue( 354): at org.appcelerator.titanium.kroll.KrollCallback.callAsync(KrollCallback.java:162) [TRACE] W/MessageQueue( 354): at org.appcelerator.titanium.kroll.KrollCallback.callAsync(KrollCallback.java:96) [TRACE] W/MessageQueue( 354): at org.appcelerator.titanium.kroll.KrollCallback.callAsync(KrollCallback.java:91) [TRACE] W/MessageQueue( 354): at ti.modules.titanium.network.TiHTTPClient.fireCallback(TiHTTPClient.java:483) [TRACE] W/MessageQueue( 354): at ti.modules.titanium.network.TiHTTPClient.fireCallback(TiHTTPClient.java:474) [TRACE] W/MessageQueue( 354): at ti.modules.titanium.network.TiHTTPClient.setReadyState(TiHTTPClient.java:506) [TRACE] W/MessageQueue( 354): at ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1022) [TRACE] W/MessageQueue( 354): at java.lang.Thread.run(Thread.java:1096) [TRACE] I/EventLogService( 195): Aggregate from 1306818776725 (log), 1306818776725 (data) [TRACE] D/dalvikvm( 195): GC_EXPLICIT freed 3577 objects / 443872 bytes in 127ms

Sometimes it worked fine and get the access token but most of the time its showing this exception of "Twitter: not sending X-Requested-With header"

mathieugerard commented 13 years ago

I believe the problem lies in "[TRACE] W/MessageQueue( 354): Handler{43ef1640} sending message to a Handler on a dead thread"

A solution has been found for this, see https://github.com/jpurcell/birdhouse/issues/9