[英]Sharepoint Online REST API with Azure AD v2.0 authentication
Is it possible to authenticate to Sharepoint Online REST API with Azure AD application v2.0 authentication?是否可以使用 Azure AD 应用程序 v2.0 身份验证对 Sharepoint Online REST API 进行身份验证? If yes, which scope should I use for requesting my permissions.
如果是,我应该使用哪个范围来请求我的权限。 Now (for MS Graph API usage) I request
"https://graph.microsoft.com/.default"
as scope but didn't find any alternative to this for Sharepoint Online REST API.现在(对于 MS Graph API 使用)我请求
"https://graph.microsoft.com/.default"
作为范围,但没有找到任何替代 Sharepoint Online REST API 的方法。
I already registered an application on apps.dev.miscrosoft.com, this application is available on portal.azure.com.我已经在 apps.dev.miscrosoft.com 上注册了一个应用程序,这个应用程序在 portal.azure.com 上可用。 There I have added required permissions for Sharepoint Online.
在那里,我为 Sharepoint Online 添加了所需的权限。
Yes you can.是的你可以。 To do this first you need to get a new access token using a regular refresh token you got for the graph already:
要首先执行此操作,您需要使用已为图形获得的常规刷新令牌来获取新的访问令牌:
POST https://login.microsoftonline.com/{{tenantName}}/oauth2/v2.0/token
Except this time pass the following for the scope header:除了这次为范围标头传递以下内容:
https://{{tenantName}}.sharepoint.com/Sites.Read.All
Your application will need to already be consented for this scope etc...您的应用程序需要已经为此范围等获得同意......
The response will give you can access token that can be used again SPO APIs.响应将为您提供可以再次使用 SPO API 的访问令牌。
It should be the same authentication with Azure AD, the scope you are looking for should be the Site scopes.它应该是与 Azure AD 相同的身份验证,您要查找的范围应该是站点范围。
https://docs.microsoft.com/en-us/graph/permissions-reference?view=graph-rest-beta#sites-permissions https://docs.microsoft.com/en-us/graph/permissions-reference?view=graph-rest-beta#sites-permissions
Do not have SharePoint sites to check but if permission are granted to the application you should be able to query SharePoint site using Azure Graph APIs.没有要检查的 SharePoint 网站,但如果向应用程序授予权限,您应该能够使用 Azure Graph API 查询 SharePoint 网站。
https://docs.microsoft.com/en-us/graph/api/resources/sharepoint?view=graph-rest-beta https://docs.microsoft.com/en-us/graph/api/resources/sharepoint?view=graph-rest-beta
Overview概述
https://docs.microsoft.com/en-us/graph/sharepoint-concept-overview https://docs.microsoft.com/en-us/graph/sharepoint-concept-overview
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.