令牌无效 - 无效令牌:无法解析引用的令牌字符串:base64 令牌上的 gaia_data.AuthSubToken 原型无效
Token invalid - Invalid token: Cannot parse referred token string: Invalid gaia_data.AuthSubToken proto on base64 token
我通过 Java 应用程序解决了 google 电子表格的问题。
我创建的应用程序在 1 年多的时间里没有任何问题,我什至在 下发布了 Google API 更改的解决方案
昨天我不知道为什么,但它停止工作,现在我只有例外:
Exception in thread "main" com.google.gdata.client.GoogleService$SessionExpiredException: Token invalid - Invalid token: Cannot parse referred token string: Invalid gaia_data.AuthSubToken proto on base64 token.
令牌无效 - 令牌无效:无法解析引用的令牌字符串:base64 令牌上的 gaia_data.AuthSubToken 原型无效。
令牌无效 - 无效令牌:无法解析引用的令牌字符串:base64 令牌上的 gaia_data.AuthSubToken 原型无效。
错误 401
at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:570)
at com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:560)
at com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:538)
at com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:536)
at com.google.gdata.client.Service.getFeed(Service.java:1135)
at com.google.gdata.client.Service.getFeed(Service.java:998)
at com.google.gdata.client.GoogleService.getFeed(GoogleService.java:645)
at com.google.gdata.client.Service.getFeed(Service.java:1017)
at SandboxAll.<init>(SandboxAll.java:155)
at SandboxCheck.main(SandboxCheck.java:207)
这是代码的一部分,之前工作正常,现在不行了:
SpreadsheetService service;
SpreadsheetFeed feed;
SPREADSHEET_FEED_URL = new URL("https://spreadsheets.google.com/feeds/spreadsheets/private/full");
com.google.api.client.json.jackson.JacksonFactory jsonFactory = new com.google.api.client.json.jackson.JacksonFactory();
String[] SCOPESArray = {"https://spreadsheets.google.com/feeds", "https://spreadsheets.google.com/feeds/spreadsheets/private/full", "https://docs.google.com/feeds"};
final List SCOPES = Arrays.asList(SCOPESArray);
GoogleCredential credential = new GoogleCredential.Builder()
.setTransport(httpTransport)
.setJsonFactory(jsonFactory)
.setServiceAccountId("xxxxxx@developer.gserviceaccount.com")
.setServiceAccountScopes(SCOPES)
.setServiceAccountPrivateKeyFromP12File(p12)
.build();
service = new SpreadsheetService("Sandbox");
service.setOAuth2Credentials(credential);
service.setReadTimeout(160000);
service.setConnectTimeout(16000);
--->feed = service.getFeed(SPREADSHEET_FEED_URL, SpreadsheetFeed.class); <---
抛出异常 feed = service.getFeed(SPREADSHEET_FEED_URL, SpreadsheetFeed.class);
我一直在互联网上寻找任何答案,但现在可以找到任何东西。
google 又改变了什么吗?
我已经重新创建了我的帐户,但这没有帮助。
(我不想编辑我的答案,所以遇到相同问题的任何人都可以尝试检查与我相同的解决方案)
我不知道,但在我的情况下,只为 feed
设置范围
String[] SCOPESArray = {"https://spreadsheets.google.com/feeds"/*, "https://spreadsheets.google.com/feeds/spreadsheets/private/full", "https://docs.google.com/feeds","https://www.googleapis.com/auth/drive"*/};
有帮助。当我显示 refreshToken()
System.out.println(credential.refreshToken());
我注意到一些 Feed 的值是错误的。
我通过 Java 应用程序解决了 google 电子表格的问题。
我创建的应用程序在 1 年多的时间里没有任何问题,我什至在
Exception in thread "main" com.google.gdata.client.GoogleService$SessionExpiredException: Token invalid - Invalid token: Cannot parse referred token string: Invalid gaia_data.AuthSubToken proto on base64 token.
令牌无效 - 令牌无效:无法解析引用的令牌字符串:base64 令牌上的 gaia_data.AuthSubToken 原型无效。 令牌无效 - 无效令牌:无法解析引用的令牌字符串:base64 令牌上的 gaia_data.AuthSubToken 原型无效。 错误 401
at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:570)
at com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:560)
at com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:538)
at com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:536)
at com.google.gdata.client.Service.getFeed(Service.java:1135)
at com.google.gdata.client.Service.getFeed(Service.java:998)
at com.google.gdata.client.GoogleService.getFeed(GoogleService.java:645)
at com.google.gdata.client.Service.getFeed(Service.java:1017)
at SandboxAll.<init>(SandboxAll.java:155)
at SandboxCheck.main(SandboxCheck.java:207)
这是代码的一部分,之前工作正常,现在不行了:
SpreadsheetService service;
SpreadsheetFeed feed;
SPREADSHEET_FEED_URL = new URL("https://spreadsheets.google.com/feeds/spreadsheets/private/full");
com.google.api.client.json.jackson.JacksonFactory jsonFactory = new com.google.api.client.json.jackson.JacksonFactory();
String[] SCOPESArray = {"https://spreadsheets.google.com/feeds", "https://spreadsheets.google.com/feeds/spreadsheets/private/full", "https://docs.google.com/feeds"};
final List SCOPES = Arrays.asList(SCOPESArray);
GoogleCredential credential = new GoogleCredential.Builder()
.setTransport(httpTransport)
.setJsonFactory(jsonFactory)
.setServiceAccountId("xxxxxx@developer.gserviceaccount.com")
.setServiceAccountScopes(SCOPES)
.setServiceAccountPrivateKeyFromP12File(p12)
.build();
service = new SpreadsheetService("Sandbox");
service.setOAuth2Credentials(credential);
service.setReadTimeout(160000);
service.setConnectTimeout(16000);
--->feed = service.getFeed(SPREADSHEET_FEED_URL, SpreadsheetFeed.class); <---
抛出异常 feed = service.getFeed(SPREADSHEET_FEED_URL, SpreadsheetFeed.class);
我一直在互联网上寻找任何答案,但现在可以找到任何东西。
google 又改变了什么吗?
我已经重新创建了我的帐户,但这没有帮助。
(我不想编辑我的答案,所以遇到相同问题的任何人都可以尝试检查与我相同的解决方案) 我不知道,但在我的情况下,只为 feed
设置范围 String[] SCOPESArray = {"https://spreadsheets.google.com/feeds"/*, "https://spreadsheets.google.com/feeds/spreadsheets/private/full", "https://docs.google.com/feeds","https://www.googleapis.com/auth/drive"*/};
有帮助。当我显示 refreshToken()
System.out.println(credential.refreshToken());
我注意到一些 Feed 的值是错误的。