I'm using the Service Account to access the Google Analytics API in Java code. It works perfectly well on my local machine. But does not work on Deployment Server.
Error is:
com.google.api.client.auth.oauth2.TokenResponseException: 400 Bad Request
{
"error": "invalid_grant",
"error_description": "Invalid JWT: Token must be a short-lived token and in a reasonable timeframe"
}
Only solution that I saw after searching many forums is to Synchronize System Clock.
But unfortunately I cannot do this as my server is hosted by third party and it is a shared server so I do not have access to System Clock.
I'm looking for solutions where setting/modifying TimeZone can resolve this. Has anyone tried this before?