2013-12-20 122 views
1

我打算整合谷歌日历v3 api。我已经安装NuGet包Google.Apis.calendar.v3包,我从谷歌谷歌日历api v3使用asp.net

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 

那里他们指定给客户和秘密ID在client_secrets.josn文件得到了样品。在执行代码时,它会将我带到浏览器并要求提供登录信息。登录后,它显示错误为无效的返回网址。

是否有任何其他方式指定回拨url。

回答

0

在Google API控制台中创建项目之后,您必须在其中定义RedirectUri的位置创建了oAuth2.0 clientID。

因此,请进入Google API控制台(http://code.google.com/apis/console)并将其更改为正确的Uri。

注意:如果在开发环境中工作,请确保使用固定IP端口,否则每次构建和运行项目时都必须更改Uri。