Youtube oAuth promts authorization window every time I make request
The issue is that the access token
that you are using has expired before the next time you use as you have not updated the access token
manually using the refresh token
.
You need to use the refresh token
to update the access token
if [ (time you last updated the access token) + (the expiry time) ] has already surpassed.
The concept of refresh tokens is that if an access token is compromised, as it is short-lived, the attacker has a limited time period in which it can be used. Refresh tokens, if compromised, are useless because the attacker requires the client id and client secret in addition to the refresh token in order to gain an access token.
The YouTube API documentation demonstrates the procedure here
By default, the expiry time is around 3 seconds.
This will surely, work in your case.