Token invalid - Invalid token: Cannot parse referred token string: Invalid gaia_data.AuthSubToken proto on base64 token
<p>I've strage issue with google spreadsheet via Java application.
I had application created which was working without any issue for more than 1 year I even posted an solution for Google API change under <a href="https://stackoverflow.com/questions/30483601/create-spreadsheet-using-google-spreadsheet-api-in-google-drive-in-java">Create Spreadsheet using Google Spreadsheet API in Google drive in Java</a>
Yesterday I don't know why but it stopped working and now I've only exception:</p>

<pre><code>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.
</code></pre>

<p>Token invalid - Invalid token: Cannot parse referred token string: Invalid gaia_data.AuthSubToken proto on base64 token.
Token invalid - Invalid token: Cannot parse referred token string: Invalid gaia_data.AuthSubToken proto on base64 token.
Error 401</p>

<pre><code>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.&lt;init&gt;(SandboxAll.java:155)
at SandboxCheck.main(SandboxCheck.java:207)
</code></pre>

<p>This is part of the code which was working fine and now it's not:</p>

<pre><code>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);
        ---&gt;feed = service.getFeed(SPREADSHEET_FEED_URL, SpreadsheetFeed.class); &lt;---
</code></pre>

<p>The exception is throw on <code>feed = service.getFeed(SPREADSHEET_FEED_URL, SpreadsheetFeed.class);</code>
I was looking for any answer in the internet but could now find anythig.
Did google again changed something ?
I've recreate my account this this did not help.</p>