【发布时间】:2019-01-17 06:39:54
【问题描述】:
我使用Googlewebauthorizationbroker.AuthorizeAsync() 来获取令牌。我在网站上使用“进程”并调用 ConsloeApp 来获取 Google Calender 的数据。它在 Visual Studio(2017) 上运行良好,但是当我放入 IIS 时,它没有打开浏览器进行授权并且 IIS 得到 .Net RunTime ERROR。
这是我的代码。希望能找到解决这个问题的办法。
Public Sub Main(args As String())
Dim userID As String = "xxx"
Dim Credential As UserCredential
Dim Stream As New FileStream("~\credentials.json", FileMode.Open, FileAccess.ReadWrite)
Dim credPath As String = "~\token.json"
Credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
GoogleClientSecrets.Load(Stream).Secrets,
Scopes,
userID,
CancellationToken.None,
New FileDataStore(credPath, True)).Result
Dim oService As CalendarService = New CalendarService(New BaseClientService.Initializer() With
{
.HttpClientInitializer = Credential,
.ApplicationName = ApplicationName
})
Fun_List(oService)
Console.ReadLine()
End Sub
这是错误信息。 enter image description here
我的问题可能喜欢这个问题。
GoogleWebAuthorizationBroker won't open browser when running on IIS
Google Auth runs in Visual studio but hangs when deployed to IIS
【问题讨论】:
标签: vb.net google-api google-calendar-api google-api-dotnet-client