Google Token Expiration
Is it possible to create a script that'll pull the token request from a google sign-in and automatically "allow permission"? Unless anyone else know show to bypass the 1 hour token expiration. Rather annoying when you want to leave it on. ;)
I know that it is possible to renew the OAuth token, and sometimes even allow for no intervention at all(besides entering email/pass). The Python bot does this without having to enter a code. I'm looking into how this is done(and hopefully others are too), and seeing if I can figure something about for this project.
@KyleBoyer Perfect! Let me know what you find.
Googling a bit on the issue too, it appears that the first time you enter the code on the google.com/device page, a refresh token is also provided. Once the regular token(not refresh token) expires, you have to use the refresh token to fetch a new regular token. So it is vital to store this refresh token(maybe even in the config file) to fetch new tokens.
"So i finally figured out how to do this. The basic idea is that you have the token you get the first time you ask for authentication. This first token has a refresh token. The first original token expires after an hour. After an hour you have to use the refresh token from the first token to get a new usable token. You use $client->refreshToken($refreshToken) to retrieve a new token. I will call this "temp token." You need to store this temp token as well because after an hour it expires as well and note it does not have a refresh token associated with it. In order to get a new temp token you need to use the method you used before and use the first token's refreshtoken. I have attached code below, which is ugly, but im new at this..."
Quote from https://stackoverflow.com/questions/9241213/how-to-refresh-token-with-google-api-client
Report this here https://github.com/Grover-c13/PokeGOAPI-Java. Also check if there's already a discussion about it first.
@KyleBoyer Could be on to something there!
As said, this is an upstream problem; closing this issue
When this is merged it should be fixed https://github.com/Grover-c13/PokeGOAPI-Java/pull/165
@jabbink when do you expect a merge?
Grover-c13/PokeGOAPI-Java#165 is merged so it works here as well now