【问题标题】:IAuthenticationProvider is deprecated in microsoft-graph:2.3.0, how do I create a GraphServiceClient instance now?IAuthenticationProvider 在 microsoft-graph:2.3.0 中已弃用,我现在如何创建 GraphServiceClient 实例?
【发布时间】:2021-01-19 10:13:27
【问题描述】:

我正在升级我的项目中的msgraph-sdk-java 库的版本。我使用的是 1.7.1 版,但在上传大于 4MB 的文件时设置冲突行为时遇到了一些问题。我看到该问题已在最新版本 (see here) 中得到修复,因此我正在尝试升级到版本 2.3.0。

我更新了我的 build.gradle 文件并注意到现在接口 IAuthenticationProvider 已被弃用。

在请求被 HTTP 发送之前为请求提供身份验证 提供者。

@deprecated 使用 ICoreAuthenticationProvider 代替

它说我应该改用 ICoreAuthenticationProvider,但是如何在不实现 IAuthenticationProvider 接口的情况下构建 GraphServiceClient 的新实例?

this.graphClient = GraphServiceClient.builder()
                .authenticationProvider(appAuthProvider)
                .buildClient();

此外,在库的自述文件中,它说我们应该使用 IAuthenticationProvider,这更加令人困惑:

【问题讨论】:

标签: java microsoft-graph-api microsoft-graph-sdks


【解决方案1】:

只要使用你想要的任何实现。

虽然它已被弃用,但它现在仍然有效。

我想更新将允许在 GraphServiceClient 构造函数中使用 ICoreAuthenticationProvider,但目前还没有。

【讨论】:

  • 那么他们不应该弃用这个
猜你喜欢
  • 2019-09-05
  • 2023-01-27
  • 2022-01-19
  • 2015-10-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多