gpt4 book ai didi

java.lang.RuntimeException : com. google.gdata.client.authn.oauth.OAuthException:oauth_token_secret 不存在

转载 作者:行者123 更新时间:2023-12-01 06:14:22 26 4
gpt4 key购买 nike

无法从 Google 获取联系人。

代码是根据谷歌文档。

GoogleOAuthParameters oauthParameters = new GoogleOAuthParameters();
oauthParameters.setOAuthConsumerKey(CLIENT_ID);
oauthParameters.setOAuthConsumerSecret(CLIENT_SECRET);
oauthParameters.setOAuthToken(tokenData);
oauthParameters.setOAuthTokenSecret("");

contacstService.setOAuthCredentials(oauthParameters, new OAuthHmacSha1Signer());

当我打电话时:

ContactFeed resultFeed = contacstService.getFeed(feedUrl, ContactFeed.class);

获取运行时异常。

我正在使用 Google+ API 进行日志记录。

另外,我将如何设置accesstoken secret ?

异常::

java.lang.RuntimeException: com.google.gdata.client.authn.oauth.OAuthException: oauth_token_secret does not exist.    at com.google.gdata.client.GoogleAuthTokenFactory$OAuthToken.getAuthorizationHeader(GoogleAuthTokenFactory.java:214)    at com.google.gdata.client.http.HttpGDataRequest.(HttpGDataRequest.java:338)    at com.google.gdata.client.http.GoogleGDataRequest.(GoogleGDataRequest.java:457)    at com.google.gdata.client.http.GoogleGDataRequest$Factory.createRequest(GoogleGDataRequest.java:94)    at com.google.gdata.client.http.HttpGDataRequest$Factory.getRequest(HttpGDataRequest.java:165)    at com.google.gdata.client.Service.createRequest(Service.java:760)    at com.google.gdata.client.GoogleService.createRequest(GoogleService.java:539)    at com.google.gdata.client.Service.createFeedRequest(Service.java:1156)    at com.google.gdata.client.Service.getFeed(Service.java:997)    at com.google.gdata.client.GoogleService.getFeed(GoogleService.java:645)    at com.google.gdata.client.Service.getFeed(Service.java:1017)    at com.google.plus.samples.quickstart.Signin$PeopleServlet.contactsList(Signin.java:409)    at com.google.plus.samples.quickstart.Signin$PeopleServlet.doGet(Signin.java:345)    at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)    at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401)    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)    at org.mortbay.jetty.Server.handle(Server.java:326)    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)    at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928)    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)    at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

最佳答案

我使用 Google Contacts API,并尝试使用 access_token 设置 setOAuthTokenSecret,它运行良好。

关于java.lang.RuntimeException : com. google.gdata.client.authn.oauth.OAuthException:oauth_token_secret 不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27888790/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com