无法使用拥有 YouTube 频道的帐户进行 OAuth [英] Unable to OAuth with account that owns YouTube channel

查看:26
本文介绍了无法使用拥有 YouTube 频道的帐户进行 OAuth的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 google 帐户,我之前使用 v2 YouTube API 将视频上传到该帐户.我猜这个帐户有两个与之关联的帐户,因为当我通过 OAuth 流程时,我必须选择哪个帐户.

I have a google account that I was previously uploading videos to using the v2 YouTube API. This account I guess has two accounts linked to it, because when I go through OAuth flows I have to choose which account.

第一个帐户,即我在开发者控制台中设置 API 的帐户,让我可以选择授权 YouTube API 控件.第二个帐户,实际上是 YouTube 频道,只是说我正在为我的应用程序提供离线访问权限,没有指定与 YouTube 相关的权限.

The 1st account, the one I setup the API in developer console, gives me the option to authorize YouTube API controls. The 2nd account, the one that actually is the YouTube channel, only says that I'm giving my application offline access, there is no permissions specified relating to YouTube.

我使用第一个帐户进行了 OAuth,因为该帐户实际上列出了 youtube 权限.得到我的刷新令牌并将其添加到应用程序中.但是,当我尝试将视频插入 YouTube 时,出现以下错误:未经授权的代码 401:youtubeSignupRequired

I did my OAuth using the 1st account, since that one actually listed youtube permissions. Got my refresh token and added it to the application. However, when I go to attempt to insert a video to YouTube I get the following error: Code 401 Unauthorized: youtubeSignupRequired

好像我根本没有链接到 YouTube 频道帐户,即使它们都在同一个 Google 帐户上.

It's as though I'm not linking at all to the YouTube channel account even though they are both on the same Google account.

有没有人遇到过这种情况?顺便说一句,我确信我的 API 调用工作正常,因为我们能够从开发环境上传.开发帐户只是一个帐户,尽管它与 API 拥有同一帐户上的频道.

Has anyone encountered this before? By the way, I know with certainty that my API calls work properly, as we were able to upload from the dev environment. The dev account is only a single account though that owns the channel on the same account as the API.

推荐答案

我能够解决这个问题.

事实证明,我需要使用第二个帐户(即 YouTube 频道的帐户)进行 OAuth.尽管它没有请求任何与 YouTube 相关的权限并且只获得离线访问权限,但我还是能够使用收到的刷新令牌成功上传.

It turned out I needed to do the OAuth with the 2nd account, the one for the YouTube channel. Despite it not requesting any permissions related to YouTube and only getting offline access, I was able to successfully upload using the refresh token I received.

绝对是最不合逻辑的解决方案是正确的一个案例.

Definitely a case of the most illogical solution being the correct one.

这篇关于无法使用拥有 YouTube 频道的帐户进行 OAuth的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆