Received authentication challenge is null


#1

I’m trying to login in adnroid application and I get a error when i do retriveRequestToken
Communication with the service provider failed: Received authentication challenge is null

What am i doing wrong here?
DefaultOAuthConsumer consumer = new DefaultOAuthConsumer(Value.TWITTER_OAUTH_KEY, Value.TWITTER_OAUTH_SECRET);
DefaultOAuthProvider provider = new DefaultOAuthProvider(“http://twitter.com/oauth/request_token”,
http://twitter.com/oauth/access_token”,
http://twitter.com/oauth/authorize”);
try {
authUrl = provider.retrieveRequestToken(consumer, Value.TWITTER_CALLBACK_URL);
} catch (OAuthMessageSignerException e) {
Log.d("",e.getMessage());
showDialogMessage(“Can’t connect to twitter”);
return;
} catch (OAuthNotAuthorizedException e) {
Log.d("",e.getMessage());
showDialogMessage(“Can’t connect to twitter”);
return;
} catch (OAuthExpectationFailedException e) {
Log.d("",e.getMessage());
showDialogMessage(“Can’t connect to twitter”);
return;
} catch (OAuthCommunicationException e) {
Log.d("",e.getMessage());
showDialogMessage(“Can’t connect to twitter”);
return;
}


#2

I’m having the same problem, has anybody found a solution for this?


#3

The time stamp on your
oAuth call is incorrect,due to this server returns a 401 status error which
on Android devices causes the “Received authentication challenge is
null” exception to be thrown. Fixing the times fixed the
problem.


#4

you have seen again :“http://twitter.com/oauth/request_token",“http://twitter.com/oauth/access_token”,"http://twitter.com/oauth/authorize” ". because, in the twitter api, you have created "https://twitter.com/oauth/access_token",“https://twitter.com/oauth/authorize”..."


#5

and token, token secret???


#6

I already fixed its. Thanks you so much :slight_smile:


#7

hey,how to fix this?


#8

Problem is time in client is not correct. For example. My timezone is GMT+7:00, and right time must be 11:34 02.02.2012. But time is 11:34 03.02.2012.
“Fixing the times fixed the problem.”


#9

Realy nice My problem Got solved


#10

Thanks boss


#11

I have received the same error, although I didnt changed my code…
error says that: Authenicated for (null)
how to configure time zone ? sorry, I am new to iOS development


#12

but where to change the settimgs ?


#13

How to change timestamp to fix this problem???


#14

any idea how to correct this in MIT app inventor?


#15

I fixed Time issue but still get this error now what i do…?

Please help me

Thanks


#16

Any idea how ??


#17

guys, twitter api is the worst api I’ve ever used


#18

Hello,

I am new to twitter API, and i had explored it a lot for four five days. I am having a problem as people above are discussing that , i am not able to get the user Info. For that, API is saying to use the following code :

 <code>User user = twitter.showUser(userID);  (1)
     //userID --> Data Type 'long' </code>

I had corrected the timezone and date, but still i am not able to get the user [at line (1) above] object in my code. showUser() method makes request to twitter server so it must be in a background or separate thread i did the same i had put the method call in the doInBackground() method of AsyncTask class. Still i failed.
Whenever i call showUser() method as above it gives the following exception :

04-28 23:02:22.880: W/System.err(8358): Received authentication challenge is nullRelevant discussions can be on the Internet at:
04-28 23:02:22.880: W/System.err(8358): http://www.google.co.jp/search?q=bb0a5eb5 or
04-28 23:02:22.880: W/System.err(8358): http://www.google.co.jp/search?q=1ef844ea
04-28 23:02:22.880: W/System.err(8358): TwitterException{exceptionCode=[bb0a5eb5-1ef844ea 5147af80-c010541d], statusCode=-1, retryAfter=0, rateLimitStatus=null, version=2.2.2}
04-28 23:02:22.880: W/System.err(8358): at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:204)
04-28 23:02:22.880: W/System.err(8358): at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:65)
04-28 23:02:22.880: W/System.err(8358): at twitter4j.internal.http.HttpClientWrapper.get(HttpClientWrapper.java:93)
04-28 23:02:22.880: W/System.err(8358): at twitter4j.TwitterImpl.get(TwitterImpl.java:1721)
04-28 23:02:22.880: W/System.err(8358): at twitter4j.TwitterImpl.showUser(TwitterImpl.java:507)
04-28 23:02:22.880: W/System.err(8358): at com.vivek.twitterconnect.MainActivity$Async.doInBackground(MainActivity.java:296)
04-28 23:02:22.880: W/System.err(8358): at com.vivek.twitterconnect.MainActivity$Async.doInBackground(MainActivity.java:1)
04-28 23:02:22.880: W/System.err(8358): at android.os.AsyncTask$2.call(AsyncTask.java:252)
04-28 23:02:22.880: W/System.err(8358): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
04-28 23:02:22.880: W/System.err(8358): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
04-28 23:02:22.880: W/System.err(8358): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1081)
04-28 23:02:22.885: W/System.err(8358): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:574)
04-28 23:02:22.885: W/System.err(8358): at java.lang.Thread.run(Thread.java:1020)
04-28 23:02:22.885: W/System.err(8358): Caused by: java.io.IOException: Received authentication challenge is null
04-28 23:02:22.885: W/System.err(8358): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.processAuthHeader(HttpURLConnectionImpl.java:1176)
04-28 23:02:22.890: W/System.err(8358): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.processResponseHeaders(HttpURLConnectionImpl.java:1118)
04-28 23:02:22.890: W/System.err(8358): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.retrieveResponse(HttpURLConnectionImpl.java:1044)
04-28 23:02:22.890: W/System.err(8358): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:736)
04-28 23:02:22.895: W/System.err(8358): at org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:146)
04-28 23:02:22.895: W/System.err(8358): at twitter4j.internal.http.HttpResponseImpl.(HttpResponseImpl.java:35)
04-28 23:02:22.895: W/System.err(8358): at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:168)
04-28 23:02:22.895: W/System.err(8358): … 12 more

So please help me guys and geeks. prompt response from any person how is sound in this API will be solicited.

Regards
Vivek