Youtube oAuth promts authorization window every time I make request

我的梦境 提交于 2019-12-05 06:29:33

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.

Sangha11

Adding the following parameter to your authentication object may help...depending on your requirements:

prompt: 'none'

This would mean no consent is gained or needed, after an initial authorization to use the app.

Go to the my accounts settings of google for this account---> go to connected apps and sites ----> manage apps: Over there can you see the permissions for youtube like this:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!