有谁知道任何Web应用程序示例,其中Oauth已经用于Google数据API?使用Java的Google Data API中的OAuth
3
A
回答
1
从我的理解(纠正我,如果我错了)。为了获取请求令牌,请将oauth_callback
设置为将oauth_token
附加到oath_callback
后的绝对路径。
从(http://code.google.com/apis/gdata/docs/auth/oauth.html)
从回调URL
当谷歌重定向到您的 应用程序,该组oauth_token是 追加到 “oauth_callback_url” URL作为提取令牌查询参数。然后,您的 应用程序应该从其URL查询 参数中提取 标记值,并重新建立oauth 参数。
如果您使用的是Google OAuth helper,那么您可以试试这个例子。
import com.google.gdata.client.docs.*;
import com.google.gdata.client.authn.oauth.*;
String CONSUMER_KEY = "example.com";
String CONSUMER_SECRET = "abc123doremi";
GoogleOAuthParameters oauthParameters = new GoogleOAuthParameters();
oauthParameters.setOAuthConsumerKey(CONSUMER_KEY);
oauthParameters.setOAuthConsumerSecret(CONSUMER_SECRET);
oauthParameters.setScope("https://docs.google.com/feeds/");
oauthParameters.setOAuthCallback("http://www.example.com/UpgradeToken.jsp");
GoogleOAuthHelper oauthHelper = new GoogleOAuthHelper(new OAuthHmacSha1Signer());
oauthHelper.getUnauthorizedRequestToken(oauthParameters);
这个例子好像是在JSP里写的。您可以使用Frameworks使用它。
oauthParameters.setOAuthCallback()
是Google添加回调URL路径以确保其令牌被返回的地方。
相关问题
- 1. 使用Appengine的Google API(OAuth)
- 2. perl中的任何Google API使用OAuth
- 3. 使用Google Data API访问Google电子表格使用Google Data API失败Mono
- 4. Linkedin api使用java中的oauth调用
- 5. 在Google Picasa Data API中使用jQuery $ .getJSON()
- 6. 在Android中使用Google API与OAuth 2.0
- 7. 使用Google Data API for Java更新Picasa上的元数据
- 8. 在Scribe-Java和Google Apps中使用OAuth
- 9. Google Buzz API OAuth问题 - 使用Zend_OAuth(PHP)
- 10. Symbian上的Google Data API
- 11. oAuth使用PHP(适用于google api)
- 12. Java Google Youtube Data API ::未授权
- 13. 使用Google Data API搜索图书
- 14. 如何使用Java + Google Data API来测量上传比特率
- 15. 错误:使用Google Youtube Data API V3 Oauth服务在IIS上拒绝访问
- 16. Google Latitude API和OAuth
- 17. OAuth API Google Drive Python
- 18. Nodejs Google OAuth API refreshaccesstoken()
- 19. 使用Google Spreadsheet API中的OAuth 2.0授权请求
- 20. GAE中使用Google Data API的本地时区问题
- 21. Google API Oauth 2.0 cron工作?
- 22. 如何使用Google Analytics API和两段OAuth(Google Apps for business)?
- 23. 在Delphi中使用Indy的Google OAuth
- 24. 消费Google Data API v2
- 25. 使用StackExchange API的OAuth
- 26. 使用OAuth与UserVoice的API
- 27. 使用Digg API的OAuth
- 28. 使用OAuth的天气API
- 29. 使用oAuth的Endomondo API
- 30. 如何在Google Analytics API中使用Zend OAuth?
没有我所知道的,但是您可以随时使用Google数据API(http://code.google.com/apis/gdata/articles/oauth.html)检查OAuth的API – 2010-03-30 00:00:46
我已检查过该示例,不知何故它不完整。它在授权请求令牌时不起作用。如果用户决定授予访问权限,我将如何进入程序?没有关于这一点。 – yogsma 2010-03-30 04:56:12
好的,然后尝试这个(http://code.google.com/apis/gdata/docs/auth/oauth.html) – 2010-03-30 15:46:41