c# - 谷歌 G-Suite / Workspace SDK
问题描述
我正在使用一套 Google.Apis NuGet 打包 SDK(例如 Google.Apis、Google.Apis.Auth、Google.Apis.Core),并且我发现了一些用于身份验证的可选参数。不是下面的“可选”评论......
initializer = new BaseClientService.Initializer
{
HttpClientInitializer = new ServiceAccountCredential(
new ServiceAccountCredential.Initializer(creds.ClientEmail)
{
User = creds.AdminEmail,
Scopes = new[] { DirectoryService.Scope.AdminDirectoryUserReadonly },
Key = RSA.Create(creds.PrivateKey),
// ***THIS IS OPTIONAL***
KeyId = creds.PrivateKeyId,
// ***THIS IS OPTIONAL***
ProjectId = creds.ProjectID
}.FromPrivateKey(creds.PrivateKey))
};
上述两个“可选”值均由 Google 网络管理界面提供,但在身份验证期间是否使用它们是我的选择。我没有找到任何解释它们代表什么以及为什么它们是可选的文档。如果我提供它们,我会得到什么或失去什么?如果我省略它们?
我可以隐约猜到这ProjectID
有一些与身份验证相关的审计跟踪目的。但另一个,我只是不知道。
帮助?
解决方案
推荐阅读
- database - 设计星形/雪花模式数据库
- image - Xamarin.Forms 在共享项目中设置图像源
- python - 脚本不会停止
- python - 从 Matlab 到 Python 的元胞数组字符串
- javascript - ReactJs:不会为最后调度 redux 操作的组件调用 componentWillReceiveProps
- php - 对使用浏览器的人隐藏文件,但在站点内对 AJAX 可见
- python - 如何在两个子图之间有一个共同的 y 标签?
- javascript - 如何通过反应读取本地服务器 JSON 文件?
- python - 如何将python代码导入顺序列为树?
- android-studio - Google Fit API 登录卡在加载时