Authentication Problem while connecting to https://stream.twitter.com/1.1/statuses/sample.json url


#1

Hi,

I have created an application under the url, https://apps.twitter.com/
and generated the corresponding access tokens. I have consumer key, consumer secret, access token, access token secret.

I have tried accessing the url, https://stream.twitter.com/1.1/statuses/sample.json for getting the live tweet data using the above credentials.

But I am getting unauthorized error like below ,

<h2>HTTP ERROR: 401</h2>
<p>Problem accessing '/1.1/statuses/sample.json'. Reason:
<pre>Unauthorized</pre>

Please help me in resolving this error.

Thanks in advance…


#2

Hi,

You have everything required to connect on sample endpoint, however there could be a problem in the way you are creating the request. Can you provide more details on the language and library you’re using to connect?

Thanks


#3

I have the same issue using ROAuth in R. Is this related to the OAuth tool being down currently?


#4

I am also having the same issue and I can’t figure it out. I’ve also tried three REST api testers and none of them work. They all give the 401 Unauthorised.
Even when i try non-OAUTH authentication (basic auth) with a twitter username and password, it doesn’t work.
Logging onto twitter itself with that username and password combination does work however.


#5

@lfcipriani : Thanks for your reply. I am using Java and org.scribe library for interacting to twitter streaming API.


#6

No, this is not related to OAuth tool.


#7

This kind of authentication is no longer available, you should use OAuth 1.0a.


#8

Are you able to execute the example this lib provides? -> https://github.com/fernandezpablo85/scribe-java/blob/master/src/test/java/org/scribe/examples/TwitterExample.java


#9

My response is below:

<html>\n
 <head>\n
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>\n
    <title>Error 401 Unauthorized</title>
</head>
<body>
    <h2>HTTP ERROR: 401</h2>
    <p>Problem accessing '/1.1/statuses/filter.json?oauth_consumer_key=1234&amp;oauth_token=1234&amp;oauth_signature_method=HMAC-SHA1&amp;oauth_timestamp=1410951291&amp;oauth_nonce=arUHr2&amp;oauth_version=1.0&amp;oauth_signature=1234='. Reason:

        <pre>    Unauthorized</pre>
    </body>
</html>

I’ve obfuscated the keys but that’s the error i’m getting.


#10

@Ifcipriani: I just regenerated the access tokens again and it started working for me . Thanks for your reply


#11

I’m also having this problem, but I’m using python with tweepy. Does anybody have a solution?


#12

Are your keys current and valid?