Google-Assistant-Unofficial-Desktop-Client icon indicating copy to clipboard operation
Google-Assistant-Unofficial-Desktop-Client copied to clipboard

Google OAuth Token keeps expiring, what to do against it?

Open Chaos02 opened this issue 4 years ago • 16 comments

Hi, it's pretty much in the title: After a couple days of using and not using it the OAuth Token needs to be reset. While this process is fairly simple it is annoying. What can I do to circumvent the token from expiring??

Chaos02 avatar Dec 02 '21 12:12 Chaos02

I have the same issue, mine keep expiring

Myoldmopar avatar Dec 13 '21 15:12 Myoldmopar

Is this expected behavior?

momo832 avatar Dec 23 '21 21:12 momo832

Yeah it is.

im-coder-lg avatar Dec 24 '21 07:12 im-coder-lg

If app is set as published in google console you can set OAuth Tokens with longer expiry date. Would need to be changed in code as well (it probably sets expiry in code since my token has been showing as expired in this app, even tho it worked in another) ;)

Otherwise it's only 7 days

MichaelDavidGK avatar Dec 26 '21 01:12 MichaelDavidGK

Is there another authentication method which would work too? And I have not dealt with that yet, but does the OAuth Token flow have a way of refreshing the tokens. So that the old one gets invalid and you get a new one with the help of a refresh token and the client id.

https://cloud.google.com/apigee/docs/api-platform/antipatterns/oauth-long-expiration

They say that you can have the refresh token can last as long as 200 days

BierDav avatar Jan 07 '22 15:01 BierDav

Interested in a solution to this as well. Will wait for someone smarter than me to come along...

rdsroka2 avatar Jan 08 '22 01:01 rdsroka2

Is there another authentication method which would work too? And I have not dealt with that yet, but does the OAuth Token flow have a way of refreshing the tokens. So that the old one gets invalid and you get a new one with the help of a refresh token and the client id.

https://cloud.google.com/apigee/docs/api-platform/antipatterns/oauth-long-expiration

They say that you can have the refresh token can last as long as 200 days

As I said above if you publish the app you get no expiry. Apparently after the program set expiration date (7 days) it still didn't ask me for new Token (most likely due to the code not forcing it after set expiration). On top of that it set expiration to Sunday, December 5, 53954 4:41:07am after it was past 7 days (I got token at 5th Dec 2021 4:41 am).

Coming to conclusion: Simply publishing app in Google Console and creatinh new Token after that will make it to not expire.

@Melvin-Abraham do you mind adding this information to README or smth?

MichaelDavidGK avatar Jan 15 '22 20:01 MichaelDavidGK

Would be kind if you offer your published app, because you have already published it and it would simplify a lot.

BierDav avatar Jan 16 '22 13:01 BierDav

I believe what @MichaelDavidGK is saying is you set the app to published in your own google console. image

johnwang16 avatar Jan 16 '22 19:01 johnwang16

Yes I'm aware of that, but it would be far more efficient when there is just one Google Cloud Platform Application. Now everybody has to make an own one. And now everybody should publish his app. When it's published it is automatically accessible to everybody why haven hundreds of Applications when just one of them would work too. This would also reduce the setup time, because you don't need to create your own Application

BierDav avatar Jan 16 '22 21:01 BierDav

There are limited API requests, user cap and other things, might also be security issue, so people would have to do it themselves anyway

MichaelDavidGK avatar Jan 16 '22 22:01 MichaelDavidGK

If app is set as published in google console you can set OAuth Tokens with longer expiry date. Would need to be changed in code as well (it probably sets expiry in code since my token has been showing as expired in this app, even tho it worked in another) ;)

Otherwise it's only 7 days

Don't you need a domain for this? I tried one and it can't find my TXT or CNMAE record...

momo832 avatar Jan 16 '22 23:01 momo832

image nope, mine is without any

MichaelDavidGK avatar Jan 16 '22 23:01 MichaelDavidGK

image I hope this means it should still work.

momo832 avatar Jan 16 '22 23:01 momo832

Don't really know, it didn't ask me to add or verify my domain at all. would be great if you can check and let us know back in 7-8 days (you still need to redo the auth token tho, as old token might still be 7 days one) image

and this is how I filled in the form for publishing (the domain was filled automatically - project_id.firebaseapp.com) image

MichaelDavidGK avatar Jan 16 '22 23:01 MichaelDavidGK

There are limited API requests, user cap and other things, might also be security issue, so people would have to do it themselves anyway

Oh I didn't know that, but that makes sense

BierDav avatar Jan 17 '22 08:01 BierDav

Does anyone know roughly how long it should take after you've pressed Publish App?

cmt29 avatar Oct 13 '22 09:10 cmt29