Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900