问题
I have a Web App running on IIS 8. This "Web App" only runs locally, we use it as a desktop app that we open through Google Chrome
. I'm trying to upload a video to YouTube
through their API. Basically my problem is here:
uc = await GoogleWebAuthorizationBroker.AuthorizeAsync(
new ClientSecrets
{
ClientId = CLIENTID,
ClientSecret = CLIENTSECRET
},
new[] { YouTubeService.Scope.Youtube },
"user",
CancellationToken.None,
new Google.Apis.Util.Store.FileDataStore(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Google.Apis.Auth.YouTube")));
This works perfectly on a console application or when running my web app in IIS Express on Visual Studio, but when I try to authenticate when my app is running on IIS it just hangs there an no browser is opened asking for authentication, I thought that this was because IIS doesn't have a UI (the same problem that using this method in Windows Services)
So I created a console app that will be called from my IIS app. When running my console app through cmd.exe
it works great as expected, but when I run it from my IIS app using Process
it hangs again in the same place.
My IIS App Pool runs as the main administrator user. Why can't I use GoogleWebAuthorizationBroker
inside IIS? Even calling a console app fails?
来源:https://stackoverflow.com/questions/38843046/googlewebauthorizationbroker-wont-open-browser-when-running-on-iis