gpt4 book ai didi

C#上传视频到Youtube,不提示用户登录: Youtube API V3

转载 作者:行者123 更新时间:2023-12-03 06:28:06 26 4
gpt4 key购买 nike

这是用 ASP.NET 和 C# 编写的
一切正常,只是想实现下面描述的内容。

我有一个程序能够使用与 ClientID 和 ClientSecret 关联的帐户将视频上传到 YouTube。唯一的问题是当我的 GoogleWebAuthorizationBroker 通过它时会提示用户登录。我想让这个程序或网站的所有用户都能够上传到该特定的 YouTube 帐户,而无需询问该 YouTube 帐户的用户名和密码。有没有办法让这成为可能?

这是提示用户登录的代码。您可以在此之前初始化帐户的登录吗?不需要用户这样做?

        UserCredential credential;
credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
new ClientSecrets { ClientId = "xxxxxxxxxxxxxxxx.apps.googleusercontent.com", ClientSecret = "xxxxxxxxxxxxxxxxxxxx" },
// This OAuth 2.0 access scope allows an application to upload files to the
// authenticated user's YouTube channel, but doesn't allow other types of access.
new[] { YouTubeService.Scope.YoutubeUpload },
"user",
CancellationToken.None
);

最佳答案

不会。在用户通过提示至少一次授予应用程序权限之前,Google 不会提供访问 token 。之后,当您调用电话时,您应该会收到访问权限,因为 Google 的用户 API 会知道权限已被授予。这是一项旨在防止恶意软件访问用户的 YouTube/Google 帐户的功能。

关于C#上传视频到Youtube,不提示用户登录: Youtube API V3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23744861/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com