Twitter Data Access - Authentication Failed with Valid Credentials

I downloaded the code from Spring Get Started Guide - Twitter Data Access https://spring.io/guides/gs/accessing-twitter/ .

I set my credentials in application.properties and didn't make any other changes. I run the app and when it tries to connect to Twitter, it fails with an exception on the ConnectController 240 line:

ResourceAccessException: org.springframework.web.client.ResourceAccessException: I / O error POST request for " https://api.twitter.com/oauth/request_token ": cannot retry due to server authentication, in streaming mode; nested exception is java.net.HttpRetryException: Unable to retry due to server streaming authentication

I have verified that the credentials are read by the application. They are valid - I am using them to connect to another application I wrote with twitter4j, although in this case I am using the token and token secret in addition to the consumer key and the consumer secret.

Any ideas?

thank

+3


source to share


1 answer


I had exactly the same problem as you: it happened because I didn't set the callback url in my Twitter setup.



Just go to your Twitter app's settings for the callback field (I used the same url as the website field).

+5


source







All Articles