我想在我的应用程序中集成雅虎。我想,未能检索雅虎集成在android中的请求令牌?
private static final String YAHOO_CALLBACK_URI = "MyApp://oauth";
public static final String YAHOO_REQUEST_TOKEN_URL = "http://api.login.yahoo.com/oauth/request_token";//api.login.yahoo.com
public static final String YAHOO_ACCESS_TOKEN_URL = "http://api.login.yahoo.com/oauth/access_token";
public static final String YAHOO_AUTHORIZE_URL = "http://api.login.yahoo.com/authorize";
CommonsHttpOAuthConsumer consumer = new CommonsHttpOAuthConsumer(YAHOO_CONSUMER_KEY, YAHOO_CONSUMER_SERECT_KEY);
OAuthProvider provider = new CommonsHttpOAuthProvider(YAHOO_REQUEST_TOKEN_URL, YAHOO_ACCESS_TOKEN_URL, YAHOO_AUTHORIZE_URL);
provider.setOAuth10a(true);
try {
String authUrl = provider.retrieveRequestToken(consumer, YAHOO_CALLBACK_URI);// Can I pass Null for callback url.
System.out.println("AuthURL = " + authUrl);
} catch (OAuthMessageSignerException e) {
e.printStackTrace();
} catch (OAuthNotAuthorizedException e) {
e.printStackTrace();
} catch (OAuthExpectationFailedException e) {
e.printStackTrace();
} catch (OAuthCommunicationException e) {
e.printStackTrace();
}
越来越
oauth.signpost.exception.OAuthCommunicationException:通信与服务提供商的失败:服务提供商回应错误:404(未找到)
为什么我们不能检索请求令牌。
嗨,我得到一个类似的错误,你解决了这个问题? – Kavitha
@ KC203不,我仍然在尝试... ...与404错误卡住.... – Panache
感谢您的答复,我已经看到了几个论坛,每个人似乎都有这个问题,我怀疑现在是否也有可能。无论如何,让我知道,如果你成功整合yahoo – Kavitha