[英]Access file and folder from Google drive from web application
根据.NET的Google Drive API 文档, 400 错误是由于在这种情况下缺少参数redirect_uri 。 您必须确保您的credentials.json
具有以下格式:
{
"installed": {
"client_id": "xxxx.apps.googleusercontent.com",
"project_id": "quickstart-xxxx",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_secret": "xxxx",
"redirect_uris": [
"urn:ietf:wg:oauth:2.0:oob",
"https://example.com"
],
"javascript_origins": [
"https://example.com"
]
}
}
其中"urn:ietf:wg:oauth:2.0:oob"
是您告诉 OAuth 服务器您希望代码在同一页面中的方式。 我强烈建议您搜索官方 Google 文档。 有关访问 Google API 的更多信息,请查看Google OAuth 文档
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.