c# - Google Drive Auth2:如何修复错误 400:redirect_uri_mismatch
问题描述
我正在尝试执行和 auth2 对 google 驱动器的请求,并且收到 redirecturi 不匹配错误。var credential = GoogleWebAuthorizationBroker.AuthorizeAsync(new ClientSecret etc..
how do we set the redirecturi property to have the same redirect uris has defined when setting up the app?
It was mentioned the fix for Google Drive v2 but I am using v3 and these are not working.
I do not see a way, in the code, to set the google drive auth redirect uri.
There must be away.
代码如下:
string[] scopes = new string[] { DriveService.Scope.Drive,
DriveService.Scope.DriveFile,};
var clientId = "txdjxtd.apps.googleusercontent.com";
var clientSecret = "didididijdiikj";
var credential = GoogleWebAuthorizationBroker.AuthorizeAsync(new ClientSecrets
{
ClientId = clientId,
ClientSecret = clientSecret
}, scopes,
Environment.UserName, CancellationToken.None, new FileDataStore("MyAppsToken")).Result;
请告诉我。谢谢
解决方案
推荐阅读
- excel - VBA清除单元格旁边的行内容
- javascript - 使用 javascript / css 的气泡爆炸动画
- architecture - 单体到微服务(涉及哪些任务?)
- laravel - Laravel - SQL查询在多对多关系中等于id的值为null
- cpu-architecture - 基本处理器架构
- selenium-webdriver - 如何在 selenium Web 驱动程序中处理具有相同名称和 id 的表中的多个图像编辑图标
- angularjs - Angular JS 中的路由错误
- javascript - ES6函数解构赋值为对象
- fortran - 错误:f77 程序中有两个主要程序
- ios - 使用 twitter 回调 url 错误登录