2010-10-28 155 views
2

我試圖獲取我的Google Apps域中所有聯繫人的列表。在Scribe-Java和Google Apps中使用OAuth

爲此,我在我的GWT應用程序中使用了Scribe-Java庫(http://github.com/fernandezpablo85/scribe-java)。然而

String resp= ""; 
OAuthService service= new ServiceBuilder() 
    .provider (GoogleApi.class).apiKey ("my-domain.com").apiSecret ("my-secret").scope (
    "http://www.google.com/m8/feeds/profiles/domain/my-domain.com/full") 
    .build(); 
Token requestToken= service.getRequestToken(); 
resp= requestToken.getToken(); 

此代碼生成以下錯誤:

org.scribe.exceptions.OAuthException: Could not find request token or secret in response: signature_invalid 
base_string:POST&https%3A%2F%2Fwww.google.com%2Faccounts%2FOAuthGetRequestToken&oauth_callback%3Doob%26oauth_consumer_key%3Dmy-domain.com%26oauth_nonce%3D-714356546%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1288255870%26oauth_version%3D1.0%26scope%3Dhttp%253A%252F%252Fwww.google.com%252Fm8%252Ffeeds%252Fprofiles%252Fdomain%252Fmy-domain.com%252Ffull 

任何想法我做錯了嗎?

我從我的Google Apps域的設置頁面獲取了apiKey和apiSecret。

+0

你找到一個解決辦法? – stephanos 2010-11-03 13:16:43

回答