Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OAuth java implementation, oauth_callback missing

My problem is I get error while trying to get request token from Yahoo. The error says Im missing oauth_callback parameter and yes I miss it because I dont need it. Ive read I need to set it to "oob" value if I dont want to use it(desktop app). And I did that but to no avail. If I set it to null the same happens. Im using OAuth for java: http://oauth.googlecode.com/svn/code/java/core/

OAuthServiceProvider serviceProvider = new OAuthServiceProvider("https://api.login.yahoo.com/oauth/v2/get_request_token",
                                                                        "https://api.login.yahoo.com/oauth/v2/request_auth",
                                                                        "https://api.login.yahoo.com/oauth/v2/get_token");
OAuthConsumer consumer = new OAuthConsumer("oob", consumerKey, consumerSecret, serviceProvider);
OAuthAccessor accessor = new OAuthAccessor(consumer);
OAuthClient client = new OAuthClient(new HttpClient4());
OAuthMessage response = client.getRequestTokenResponse(accessor, OAuthMessage.POST, null);
System.out.println(response.getBodyAsStream());
like image 608
l245c4l Avatar asked May 24 '26 00:05

l245c4l


1 Answers

Have you tried using Scribe?

I also had problems with OAuth java libs so I developed that one. It's pretty much cross provider and better documented than the one you're using.

If it does not work with Yahoo you can easily extend it creating your own Provider

Hope that helps!

like image 151
Pablo Fernandez Avatar answered May 26 '26 12:05

Pablo Fernandez



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!