xiaomingchen / jwebsocket

Automatically exported from code.google.com/p/jwebsocket
1 stars 0 forks source link

Twitter Plug-in throws 401 error on click of TwitterLogin #170

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Set the twitter app access and authentication keys in JWEbSockets.xml 
2. Login to JWebSocket with root user and click on Twitter LogIn
3. A new window opens with error

What is the expected output? What do you see instead?
Twitter app page getting opened for authentication for oAuth

What version of the product are you using? On what operating system?
version 1.0b5 [windows 7]

Please provide any additional information below.

log:

jWebSocket 'response' token received, full message: 
'{"type":"response","code":-1,"msg":"TwitterException: 401:Authentication 
credentials (http://dev.twitter.com/pages/auth) were missing or incorrect. 
Ensure that you have set valid conumer key/secret, access token/secret, and the 
system clock in in sync.\n\n\n Desktop applications only support the 
oauth_callback value 'oob'\n 
/oauth/request_token\n\n","utid":7,"ns":"org.jwebsocket.plugins.twitter","reqTyp
e":"requestAccessToken"}
jWebSocket 'response' token received, full message: 

Original issue reported on code.google.com by bandana....@gmail.com on 4 Apr 2012 at 8:21

GoogleCodeExporter commented 9 years ago
I have even updated my system clock with internet and made my Twitter Apps 
access rights as Read and Write and then set all values properly in 
JWebSocket.xml and started the server but same problem

Original comment by bandana....@gmail.com on 4 Apr 2012 at 8:28

GoogleCodeExporter commented 9 years ago
Hi I am able now to authenticate by putting callback url in twitter app via 
dev.twitter.com.
But still I am not getting the Twitter Streams via Twitter4J in web sockets. It 
gives following error:

jWebSocket 'event' token received, full message: '{"message":"Network is 
unreachable: 
connect","ns":"org.jwebsocket.plugins.twitter","exception":"TwitterException","n
ame":"exception","type":"event"}

Original comment by bandana....@gmail.com on 5 Apr 2012 at 11:39

GoogleCodeExporter commented 9 years ago
Hi,

Found the problem and solved it.

Problem:
The latest Streaming API of Twitter allows SSL only   [ 
https://dev.twitter.com/blog/streaming-api-turning-ssl-only-september-29th ]

Solution:
The following 2 things have to be done to accommodate it:

1.  Replace the latest snapshot from Twitter (atleast 2.2.5 snapshot). currently 
JWebSocket has “twitter4j-core-2.1.12.jar”, which needs to be replaced with 
v2.2.5.
2.  Adding setStreamBaseURL("https://stream.twitter.com/1/") in the 
TwitterPlugin class [Infact just modifying this works even if we don’t 
replace the old twitter4j-core-2.1.12.jar file]

Original comment by bandana....@gmail.com on 16 Apr 2012 at 1:42

GoogleCodeExporter commented 9 years ago
This issue can be closed now.

Original comment by bandana....@gmail.com on 16 Apr 2012 at 1:43