GoogleWebAuthorizationBroker won't open browser when running on IIS

和自甴很熟 提交于 2019-12-11 02:02:07

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!