Hello,
I have built a connector which automates video upload to a Youtube channel using Youtube API v3, authenticating to Google using OAuth2 via Google API Client for PHP.
At first run, OAuth2 flow prompts user for consent (requiring physical attendance in the process), and then return access_token and refresh_token.
At next run, following access_token are regenerated programatically using the refresh_token.
My app has a status of "Testing", and is configured for external user type (a free Google user account, i.e. not a service account) and requires access to "youtube.force-ssl". As per this documentation, a refresh token will last only 7 days.
It's just google sucking as usual. You may be able to get around that limit by using a 'service account'.
https://developers.google.com/identity/protocols/oauth2/service-account
Hi @lxp200,
Welcome to Google Cloud Community!
Here are the following involve descriptions:
1. Do I understand correctly that the webapp user will have to go manually into a consent screen every 7 days?
2. What are my options to extend this delay so that unattended video uploads are not failing at some point (when refresh token has expired)?
3. I am under the impression that "publishing" the Google Cloud app would make no sense since it is meant to be used exclusively by one Google Cloud user, which is fine a private webapp that will be used only by a few people.
4. What if the webapp code is then hosted by other people totally unrelated to me and my instance, with their own Google account. Will they all have to "publish" their own Google App to obtain a long lasting refresh token?
I hope the above information is helpful.
Hi Ralphyjade
Thanks a lot for you information of that "refresh token 7 days expiration".
If the app requests a subset of the following: name, email address, and user profile (through the userinfo.email, userinfo.profile, openid scopes or their OpenID Connect equivalents) or its only used for Sign In to the APP. Therefore, there is no need to add them as test users, they will be allowed to access the APP and their tokens won't expire after 7 days.
Then how to implement above so we can avoid that 7 days issue?
thanks a lot in advance!!