Scala-TwitterStreamer icon indicating copy to clipboard operation
Scala-TwitterStreamer copied to clipboard

Oauth stream not properly working

Open RockyRx opened this issue 12 years ago • 0 comments

Hi,

I'm trying to use the Oauth streaming example. But I'm getting an error

[info] Running com.streamer.twitter.TestOAuthStream 
[INFO] AuthChallengeProcessor - basic authentication scheme selected
[INFO] HttpMethodDirector - No credentials available for BASIC 'Firehose'@stream.twitter.com:443
org.apache.commons.httpclient.HttpException: There was a problem connecting, HTTP code received was: 401 HTTP/1.1 401 Unauthorized

I changed the TestOAuthStream.scala to get sample stream, just because I want to see how a tweet would look like

val twitterClient = new OAuthStreamingClient(consumer, token, processor)
twitterClient.sample

And since the 1.0 is deprecated I also changed the URL's in TwitterStreamer.conf

twitterStreamUrl   = "https://stream.twitter.com/1.1/statuses/sample.json"

and there was also an issue in OAuth.scala

line 48 should be

httpMethod.setRequestHeader("Authorization: ", "OAuth " + encodedHeaders)

I checked it with Oauth tool, and that's the correct way of defining the Authorization header.

All that is checked still I'm getting the above error. Please help me to figure out the issue with your expertise.

Thanks.

RockyRx avatar Sep 19 '13 06:09 RockyRx