我打算整合Google Calendar v3 API。我已经安装了NuGet包Google.Apis.calendar.v3包,并且我从Google那里获得了示例
Dim credential As UserCredential
Using stream As New FileStream("client_secrets.json", FileMode.Open, FileAccess.Read)
credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
GoogleClientSecrets.Load(stream).Secrets, scopes, "user", CancellationToken.None,
New FileDataStore("Calendar.VB.Sample")).Result
End Using
他们在那里指定要在client_secrets.josn文件中提供客户端和机密ID。在执行代码时,它将带我到浏览器并询问登录详细信息。登录后,显示错误为无效返回网址。
还有其他方法可以指定回叫网址。
在Google API控制台中创建项目后,您必须已经在定义RedirectUri的地方创建了oAuth2.0 clientID。
因此,请进入Google API控制台(http://code.google.com/apis/console)并将其更改为正确的Uri。
注意:如果在开发环境中工作,请确保使用固定的IP端口,否则每次构建和运行项目时都必须更改Uri。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句