Google Site Verification API .NET重定向uri不匹配错误

时间:2014-10-13 19:08:08

标签: asp.net google-drive-api

我正在尝试将Google云端硬盘服务集成到我的.Net(4.0)网络应用程序(我的第一次)。但是当我尝试在本地系统中运行时,我收到重定向不匹配错误。

我已在Google Developer Console中创建了Google OAuth 2.0 ClientID和密码。

我的重定向Uri:http://localhost:58207/oauth2callback

string[] scopes = new string[] { DriveService.Scope.Drive,
                                 DriveService.Scope.DriveFile};           
UserCredential credential =  GoogleWebAuthorizationBroker.AuthorizeAsync(new ClientSecrets
                                      {
                                          ClientId = "my client id"
                                         ,ClientSecret = "my client secret"
                                      }
                                      , scopes
                                      , Environment.UserName
                                      , CancellationToken.None ).Result;

            DriveService service = new DriveService(new BaseClientService.Initializer()
            {
                HttpClientInitializer = credential,
                ApplicationName = "Google drive Integration",
            });    

请帮我解决这个问题

0 个答案:

没有答案