Youtube API with HTTP

Hello team,

I have a problem with Youtube API.

I can connect with the HTTPS module and make my GET request to obtain videos.

However, after 5/10 minutes, if I try another request I get a 401 which tells me :
Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See 將 Google 登入整合至網頁應用程式  |  Authentication  |  Google for Developers.

I have to make a new identification in order for it to work again.

Have you ever had the same problem?

NB: I have the same problem with google drive but I only have to re-authenticate once a month.

regards,

Are you adding the Refresh token parameters correctly?

For more information, see

2 Likes

Did you set your custom GCP app to “In production”?

3. Publish your GCP OAuth2 app

Direct Link: https://console.cloud.google.com/apis/credentials/consent

You might need to set your OAuth application to “Production”, otherwise the credentials expire very frequently.

1. To do this, go to menu item “OAuth consent screen”

or click here https://console.cloud.google.com/apis/credentials/consent

2. Then click the button below if the Publishing status is not “In production”

For more information, see Gmail/Google Drive verification issues (error 400): how to solve

2 Likes

Hello,

Thx for you answer.

Yes, it’s “In Production”.

This morning he still doesn’t work

I try to use that but nothing change

image

When I go through the reuatorisation process, the last validation page shows me this.

When I close it, the green check still appears

image

Is a problem too ?