I'm using Youtube V3 .net library in My web application. It is working fine on my local machine. But While I deploy it on my local IIS and try to all it on browser then It is showing me exception of
"Failed to launch browser with "https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&response_type=code&client_id=201573269273-eoteo6aj8hqq3343qi0qvc6378qt3q22.apps.googleusercontent.com&redirect_uri=http%3A%2F%2F127.0.0.1%3A54419%2Fauthorize%2F&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fyoutube.upload" for authorization. See inner exception for details."
And In it inner exception it is showing me "Access Denied".
Please help out in this.
Following code I'm using:-
What I have tried:
UserCredential credential;
using (var stream = new FileStream(JsonClient, FileMode.Open, FileAccess.Read))
{
credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
GoogleClientSecrets.Load(stream).Secrets,
// 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
);
}
Thanks In advance