OAuth java, oauth_callback is missing

My problem is that I get an error when trying to get the request token from Yahoo. The error says that I am missing the oauth_callback parameter, and yes, I miss it because I do not need it. Ive read I need to set the value to "oob" if I do not want to use it (desktop application). And I did it, but to no avail. If I set the value to zero, this will happen. 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());
+3
source share
4 answers

Have you tried using Scribe ?

OAuth java libs, . , , .

Yahoo, , Provider

, !

+1

Java OAuthMassage, , addRequiredParameters thie line if (pMap.get(OAuth.OAUTH_CALLBACK) == null) {           addParameter (OAuth.OAUTH_CALLBACK, consumer.callbackURL);       } , : rbouadjenek@gmail.com

+1

, , URL- . OAuth 1.0a (http://oauth.net/advisories/2009-1/ http://oauth.net/core/1.0a/), URL- , ( , ), , ​​ ( ). , Yahoo , .

0

, - , SDK Java OAuth, Yahoo :
http://developer.yahoo.net/blog/archives/2010/07/yos_sdk_for_java.html

Developers trying to access Yahoo services through OAuth with Java may find parts of this SDK useful.

0
source

Source: https://habr.com/ru/post/1738895/


All Articles