简体   繁体   English

使用 Azure AD v2.0 身份验证的 Sharepoint Online REST API

[英]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.

相关问题 Azure AD v2.0使用令牌进行MobileApp身份验证 - Azure AD v2.0 using the token for MobileApp authentication 使用Azure AD v2.0进行安全保护时,在[Authorize]装饰的Web API方法上获取404 - Getting 404 on the [Authorize] decorated Web API method when securing with Azure AD v2.0 我可以使用Azure v2.0身份验证来获取OneNote API的访问令牌 - Can I use Azure v2.0 authentication to get access token for OneNote API WSO2 与 Azure AD 的集成 - 访问 https://outlook.office365.com/api/v2.0/me 时为 403 - WSO2 integration with Azure AD - 403 when accessing https://outlook.office365.com/api/v2.0/me microsoft graph api和Azure v2.0的测试环境 - Test environment for microsoft graph api and Azure v2.0 如何使用 v1 Azure AD 应用程序和客户端凭据访问 Sharepoint 在线 API - How to Access Sharepoint Online API with v1 Azure AD Application and Client Credentials 使用 Azure AD 承载令牌返回容器列表时身份验证失败 [Azure Blob] [Azure AD OAuth 2.0] [REST API] - Authentication Failed while using Azure AD Bearer Token, to return list of containers [Azure Blob] [Azure AD OAuth 2.0] [REST API] 是否可以使用Azure AD身份验证访问SharePoint Online数据? - Is It Possible To Access SharePoint Online Data Using Azure AD Authentication? 将IP地址身份验证添加到Windows Azure AD或SharePoint Online? - Add IP Address Authentication to Windows Azure AD or SharePoint Online? 代表 MSA(Microsoft 个人)和 AAD 帐户的 Azure Ad v2.0 端点 - On-behalf-of on Azure Ad v2.0 endpoint for both MSA (Microsoft personal) and AAD accounts
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM