有誰知道任何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. java-oauth with google picasa data api
- 2. 使用Appengine的Google API(OAuth)
- 3. perl中的任何Google API使用OAuth
- 4. Java Google表格API OAuth 2.0
- 5. 使用Google Data API訪問Google電子表格使用Google Data API失敗Mono
- 6. Linkedin api使用java中的oauth調用
- 7. 在Google Picasa Data API中使用jQuery $ .getJSON()
- 8. 在Google Calendar API中使用OAuth PHP庫
- 9. 在Android中使用Google API與OAuth 2.0
- 10. 使用Google Data API for Java更新Picasa上的元數據
- 11. Google API OAuth 2.0
- 12. 在Scribe-Java和Google Apps中使用OAuth
- 13. 在Java中使用OAuth 2.0和Google Spreadsheet API的示例是什麼?
- 14. Google Buzz API OAuth問題 - 使用Zend_OAuth(PHP)
- 15. oAuth使用PHP(適用於google api)
- 16. Symbian上的Google Data API
- 17. Java Google Youtube Data API ::未授權
- 18. 使捲曲要求給Google的OAuth API
- 19. 使用Google Data API搜索圖書
- 20. 使用Google登錄授權YouTube Data API
- 21. Google oauth使用js api獲取refresh_token
- 22. RestKit Oauth 2 Google API
- 23. oauth,python和google API?
- 24. Nodejs Google OAuth API refreshaccesstoken()
- 25. Google Latitude API和OAuth
- 26. OAuth API Google Drive Python
- 27. 如何使用Java + Google Data API來測量上傳比特率
- 28. 錯誤:使用Google Youtube Data API V3 Oauth服務在IIS上拒絕訪問
- 29. 使用Google Spreadsheet API中的OAuth 2.0授權請求
- 30. 使用Google Apps for Business的OAuth驗證Google Drive API可能嗎?
沒有我所知道的,但是您可以隨時使用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