未知的授权标头 - 错误401

我正在使用HMAC-SH1标志访问Google电子表格Feed。我的代码是:
GoogleOAuthParameters oauthParameters = new GoogleOAuthParameters();
        oauthParameters.setOAuthConsumerKey(CONSUMER_KEY);
        oauthParameters.setOAuthConsumerSecret(CONSUMER_SECRET);
        oauthParameters.setScope("https://spreadsheets.google.com/feeds/");
        oauthParameters.setOAuthType(OAuthParameters.OAuthType.THREE_LEGGED_OAUTH);
        oauthParameters.setOAuthToken(request.getSession().getAttribute("oauth_token").toString());
        oauthParameters.setOAuthTokenSecret(request.getSession().getAttribute("oauth_token_secret").toString());

GoogleService googleService = new GoogleService("wise", "searceapps-searcegadget2-1");
        googleService.setOAuthCredentials(oauthParameters, new OAuthHmacSha1Signer());
        URL feedUrl = new URL("https://spreadsheets.google.com/feeds/spreadsheets/private/full/");

        SpreadsheetFeed resultFeed = googleService.getFeed(feedUrl, SpreadsheetFeed.class);
但是,我收到错误:   Oauth.requestServlet doGet:null   com.google.gdata.util.AuthenticationException:   确定未知   授权标题    未知   授权标头错误   401      在   com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:600)     在   com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:563)     在   com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:552)     在   com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:530)     在   com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:535)     在   com.google.gdata.client.Service.getFeed(Service.java:1135)     在   com.google.gdata.client.Service.getFeed(Service.java:998)     在   com.google.gdata.client.GoogleService.getFeed(GoogleService.java:631)     在   com.google.gdata.client.Service.getFeed(Service.java:1017)     在   Oauth.accessFeeds.access(accessFeeds.java:74) 这有什么问题?     
已邀请:
我怀疑服务器正在发送“401 Unauthorized”响应,其中包含客户端代码无法识别的WWW-Authenticate标头。它甚至可能根本不发送WWW-Authenticate标头...在异常消息中显示“null”。 (后者违反了HTTP 1.1规范。需要401响应才能获得客户端用来决定如何进行身份验证的WWW-Authenticate标头。有关详细信息,请参阅规范。) 那么为什么这会发生与Google Feed的对话呢?也许您已使用错误的URL配置了客户端?也许你的客户试图通过一些设计不良的代理进行连接?     
请参阅Android Google日历授权问题。 Google正在使用日历源执行不同的操作,使用查询字符串中的新“gsessionid”参数重定向;电子表格可能是同样的问题。     

要回复问题请先登录注册