Google drive API v2上传失败

问题描述 投票:1回答:1

[我正在尝试使用Google Drive API v2,vb.net 2015,Windows 10 Pro 1909版。调用以下“ CreateService”过程时,我的代码抛出“ 错误:redirect_uri_mismatch”:

Public Sub CreateService()
   Dim ClientId = "xxxxxxxxxxxe9gqt7105uofe6q1hmks4e89m.apps.googleusercontent.com"
   Dim ClientSecret = "xxxxxxxxxxxxxxxxxxxxx"
   '
   Dim MyUserCredential As UserCredential = _
       GoogleWebAuthorizationBroker.AuthorizeAsync(New ClientSecrets() _
       With {.ClientId = ClientId, .ClientSecret = ClientSecret}, _
       {DriveService.Scope.Drive}, "user", CancellationToken.None).Result
   Service = New DriveService(New BaseClientService.Initializer() with _
       {.HttpClientInitializer = MyUserCredential, .ApplicationName = "My Drive"})
End Sub

[我正在尝试使用Google Drive API v2,vb.net 2015,Windows 10 Pro 1909版上传到Google驱动器。当执行以下“ CreateService”过程时,我的代码抛出“错误:redirect_uri_mismatch ...

vb.net
1个回答
0
投票

我不确定。我去过API控制台来设置一个帐户并获得OAuth凭据。但是不知道如何获取重定向URL或重定向URI。我在某处缺少什么!

© www.soinside.com 2019 - 2024. All rights reserved.