Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

OAuth Authentication for YouTube API fails for manager accounts after the beginging of August 2024

$
0
0

I have been using Google Apps Script in a Google Sheet with the OAuth2 library to interact with the YouTube API based on data from a Google Sheet. My Google account has been granted YouTube Manager access to the YouTube channel I want the API to interact with. If I generate an authentication link using the run function in Apps Script and give that link to the owner of the YouTube channel, they are not able to authenticate. The consent screen works as it should, but the process fails at the last step of the authentication, resulting in the error message: "The state token is invalid or has expired. Please try again." However, if I try to authenticate using the owner’s Google account, the authentication works flawlessly.

I have set this up on several YouTube accounts in the past, authenticating an account that is not the channel owner but has full manager access to the YouTube channel. The last time I got it to work successfully was July 30, 2024. When I tried again in the first week of August, it was not working and has not worked since.

I am using this setup in Apps Script: https://github.com/googleworkspace/apps-script-oauth2#1-create-the-oauth2-service

I have tried to generate new OAuth credentials, create new Google Cloud projects, and even tested on other sets of Google and YouTube accounts. I tested on both an organizational account as well as personal Google accounts. The URI is correct. The consent screen is set to User Type: External. I have encountered the same symptom (error message) before when the user type was set to Internal, so I suspect it might be a similar issue.


Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>