gpt4 book ai didi

java - Sharepoint Online REST API 连接

转载 作者:行者123 更新时间:2023-12-02 00:11:20 26 4
gpt4 key购买 nike

我正在尝试从 Java 连接到 Sharepoint Online REST API。

我以前使用过直接在 Sharepoint 系统中注册的 SharepointOnline 加载项,该加载项具有对所有网站集 (Fu​​llControl) 的权限。 我从以下网址获取了带有应用程序凭据的 token : https://accounts.accesscontrol.windows.net// token /OAuth/2我可以直接向 Sharepoint REST API 发出请求

现在我必须切换到 Azure 注册的应用程序。代码是用 Java 编写的,我使用 Azure sdk-com.microsoft.azure (artifactId-azure)。我可以成功检索 token ,但这对于以后对 Sharepoint REST API 的请求无效。

我收到此错误:引发了“Microsoft.IdentityModel.Tokens.AudienceUriValidationFailedException”。”

是否有可能为 Sharepoint REST API 请求获取有效 token ?

最佳答案

是的,这是可能的。查看以下文档:

https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azuread

When using SharePoint Online you can define applications in Azure AD and these applications can be granted permissions to SharePoint, but also to all the other services in Office 365. This model is the preferred model in case you’re using SharePoint Online, if you’re using SharePoint on-premises you have to use the SharePoint Only model via based Azure ACS as described in here.

希望这有帮助!

关于java - Sharepoint Online REST API 连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58118421/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com