I have read most of the developer console references.
- I've created an installed project in the Google Developers Console under the "YouTube Manager Google account" of the YouTube site.
- I've enabled YouTube Data API v3 and YouTube Analytics v1.
- I've created a credential for an installed project.
The code authenticates with no problem:
UserCredential credential;
using (var stream = new FileStream(hds_opo_youtube_service.Properties.Settings.Default.clientIDFile, FileMode.Open, FileAccess.Read))
{
credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
GoogleClientSecrets.Load(stream).Secrets,
// This OAuth 2.0 access scope allows for read-only access to the authenticated
// user's account, but not other types of account access.
new[] { YouTubeService.Scope.YoutubeReadonly,
YouTubeAnalyticsService.Scope.YtAnalyticsReadonly},
"user",
CancellationToken.None,
new FileDataStore(this.GetType().ToString())
);
}
var youtubeService = new YouTubeService(new BaseClientService.Initializer()
{
HttpClientInitializer = credential,
ApplicationName = this.GetType().ToString()
});
An Error occurred: Google.Apis.Requests.RequestError Forbidden [403] Errors [ Message[Forbidden] Location[ - ] Reason[forbidden] Domain[global] ]
I have tried to resolve the situation using the API Explorer. It has been very helpful. When I try to authenticate using the YouTube Manager Owner profile account. The query fails. But if I use the Google+ page account, which is different, I can get the query to work. The Google+ page account has an email account but all correspondence with the Google+ page account is directed to the manager owner profile account. So I tried to add the Google+ page account to the project permissions, but there is no way of confirming the link. I think my problem is that the YouTube Channel is owned by the Google+ page account. The manager owner assigned has a different account, a profile account, even though it is the manager of the youtube account. I know this sounds really confusing. Does anyone have any ideas on how to solve the problem. Thanks