What are the settings in twiitter side?
Quote:
Originally Posted by
habuma
I'm not sure what's out of place here. I've tried this several times, both with SimpleClientHttpRequestFactory and with HttpClient and it works fine either way.
One thing that might help is to break it down to simple parts. Try running the following test and see if it works for you:
Code:
import org.junit.Test;
import org.springframework.social.oauth1.OAuth1Template;
import org.springframework.social.oauth1.OAuthToken;
public class OAuth1TemplateExplorationTest {
@Test
public void stuff() {
String consumerKey = "your twitter key";
String consumerSecret = "your twitter secret";
OAuth1Template oauth = new OAuth1Template(consumerKey, consumerSecret,
"https://api.twitter.com/oauth/request_token",
"https://api.twitter.com/oauth/authorize",
"https://api.twitter.com/oauth/access_token");
OAuthToken requestToken = oauth.fetchRequestToken("http://localhost:8080/spring-social-showcase/connect/twitter", null);
System.out.println(requestToken.getValue() + " :: " + requestToken.getSecret());
}
}
Be sure to plug in your application's key and secret in the appropriate variables. You might also try running Spring Social Showcase in the same environment as you are running our own code, just to rule out any environmental issues.
Finally, if your code exists in a GitHub repo somewhere then I can try running it myself and see if I can nail down the problem. (I can't stress enough how helpful code in GitHub is when trying to track down things like this.)
Hi Craig,
I'm running this unit test, it works fine, when I use twitter "consumerKey" and "consumerSecret" from the "spring-social-showcase" example project.
However, I put my "consumerKey" and "consumerSecret", it throws 406 exception.
This makes me think that, may be something is different in the way these twitter keys are setup.
What could be different?
Thanks
Nambi