我正在尝试获取youtube品牌帐户的凭据,但它仅停留在授权页面上。 这是代码-
string[] scopes = new string[] { "https://www.googleapis.com/auth/youtube", "https://www.googleapis.com/auth/youtube.force-ssl", "https://www.googleapis.com/auth/youtube.readonly", "https://www.googleapis.com/auth/youtube.upload", "https://www.googleapis.com/auth/youtubepartner", "https://www.googleapis.com/auth/youtubepartner-channel-audit", "https://www.googleapis.com/auth/youtube.upload" };
UserCredential credentials;
Console.WriteLine("Requesting authorization");
using (var stream = new FileStream(Path.Combine(Environment.CurrentDirectory, channelinfo.SecretFileName), FileMode.Open, FileAccess.Read))
{
credentials = GoogleWebAuthorizationBroker.AuthorizeAsync(
GoogleClientSecrets.Load(stream).Secrets,
scopes,
"user",
CancellationToken.None,
new FileDataStore(Directory.GetCurrentDirectory() + "\\AccessToken\\" + channelinfo.AnalyticsAPIFileDataStore, true)).Result;
}
,当我们传递用户ID和品牌帐户的密码后,它始终显示401。你能帮忙吗?