- Notifications
You must be signed in to change notification settings - Fork410
Description
Summary
StoredCredential file is not cleaned out by gradle
Sample Name
Google Calendar Quickstart
Expected Behavior
There should be a clean gradle command that really does clean, given that in the example atokens/StoredCredential file gets created when you first run the example.
Actual Behavior
The user is unaware of the fact that atokens/StoredCredential file gets dumped when running thecalendar/quickstart example the first time. The user takes care of thecredentials.json file as per instructions onthis page.
If after a while, the credentials expire (like in test mode, after 7 days, say) and the user then tries to rerun the example, even with a new, valid regeneratedcredentials.json the sample code will fail, leaving the user a bit puzzled. The user gets an error like:
> Task :run FAILEDException in thread "main" com.google.api.client.auth.oauth2.TokenResponseException: 400 Bad RequestPOST https://oauth2.googleapis.com/token{ "error": "invalid_grant", "error_description": "Token has been expired or revoked."}with little indication of why, because after getting new credentials, calls will still fail.
Adding a Gradle command like for examplegradle cleanStoredCredential and a good.gitignore file may help.
Specifications
- Java version (
java -version) as specified in gradle - OS (Mac/Linux/Windows) any