microsoft-graph-api - AcquireTokenAsync 在没有有效的 cilent 密码的情况下正常工作
问题描述
我可以使用下面的代码让 AccessToken 与 MS Graph 一起使用
var credentials = new ClientCredential(accessRequest.ClientId, accessRequest.ClientSecret);
var authContext = new AuthenticationContext($"{accessRequest.Authoriy}/{accessRequest.Domain}/");
var result = await authContext.AcquireTokenAsync(accessRequest.Resource, credentials);
var graphAccess = new Library.Service.Implements.GraphCalendarService(result.AccessToken);
var mailsBox = await graphAccess.GetMailboxSettings(accessRequest.User);
这里奇怪的是第一行中使用的 [accessRequest.ClientSecret] 的值 = "qwerty"。
这是一个错误还是我需要找到另一种使用 MS Graph 的方法(条件:需要有效的 ClientId 和 ClientSecret)?
提前致谢。
解决方案
推荐阅读
- powershell - 作为脚本的一部分执行时,Start-Job 不起作用
- javascript - 如何查看多边形开放层
- docker - Docker rabbitmq 映像失败并显示 [error] Too short cookie string
- python - 如何制作一个 5 分钟的循环计时器,在与其他应用程序一起打开时始终“保持在最前面”?
- c++ - Apache Thrift 超时
- python - C++ last_write_time 与 Python 的比较
- javascript - 使用多个数组解析 JSON 并在 HTML 中显示结果
- javascript - 使用 initComplete 在 Shiny 应用程序中使用 Javascript 定位特定的 DT::datatable 表
- python - Python 程序有时会以“IndexError: string index out of range”退出,有时运行良好
- javascript - 续集多对多深层嵌套关联