繁体   English   中英

将OAuth与Scribe-Java和Google Apps结合使用

[英]Using OAuth with Scribe-Java and Google Apps

我正在尝试获取Google Apps域内所有联系人的列表。

为此,我在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。

这是抄写员的错误。

在这里看看这个问题:

https://github.com/fernandezpablo85/scribe-java/issues#issue/33

我的GWT GData OAuth演示: http : //code.google.com/p/gwt-examples/wiki/DemoGwtGData

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM