Since recently I didn't have any problems to obtain an id token and use it, but since maybe two weeks obtaining a new token (deleting the old and obtaining a new one) and verifying it doesn't work properly.
I have an android app on the client side and a java-servlet on the server-side. The verification is done like described here. The client obtains a token with the GoogleAuthUtil.getToken() method. There is no problem obtaining a new token and verifying it. The problem occurs when I try to clear the old token with GoogleAuthUtil.clearToken() and obtain a new token. The verification fails. Checking on https://www.googleapis.com/oauth2/v1/tokeninfo?id_token= shows me that the token is valid. After resending the same token manually to the backend verifiers the token succesfully.
It seems like the google api takes longer to aknowledge the new token then the call from my client to backend. Or is my code incorrect? What I don't get that the problem occured suddenly.
Thank You
EDIT: Found the problem. It wasn't with the api. The problem was that the server time was behind. After syncronizing the clock everything seems to work.