简体   繁体   English

用户同意使用 Microsoft Graph API 读取 Outlook/Teams/Sharepoint

[英]User Consent to read Outlook/Teams/Sharepoint using Microsoft Graph API

I have to read User emails (particular subfolder), One Drive, Team Channels and Sharepoint after some regular intervals at the background using Microsoft Graph API but not without having the user consent which should be taken only once when they logged in to the web based application first time and not afterwards.我必须使用 Microsoft Graph API 在后台定期阅读用户电子邮件(特定子文件夹)、One Drive、Team Channels 和 Sharepoint,但未经用户同意,在他们登录基于 Web 时只应读取一次第一次申请,而不是之后。 I am not sure where to start from and how this can be achieved?我不确定从哪里开始以及如何实现? Should the token be stored forever in some database securely OR Is it the AAD?令牌应该永远安全地存储在某个数据库中还是 AAD?

Would really appreciate any pointers/APIs/Libraries/concepts or links which can help in moving towards this direction.非常感谢任何有助于朝着这个方向前进的指针/API/库/概念或链接。

If you want to get the token without user, client credentials flow can be used.如果您想在没有用户的情况下获取令牌,可以使用客户端凭据流 The flow permits a web service (confidential client) to use its own credentials, instead of impersonating a user, to authenticate when calling another web service.该流程允许 Web 服务(机密客户端)在调用另一个 Web 服务时使用其自己的凭据而不是模拟用户进行身份验证。

In the client credentials flow, permissions are granted directly to the application itself by an administrator.在客户端凭据流中,权限由管理员直接授予应用程序本身。 So it is necessary to use the application permissions .所以有必要使用应用程序权限 You could call Microsoft Graph API with the access token.您可以使用访问令牌调用 Microsoft Graph API。

For example, call this API to get message:比如调用这个API来获取消息:

You need to add one of the application permissions to API permission(navigate to Azure Active Directory-> your application), and click grant for your tenant .您需要将应用程序权限之一添加到 API 权限(导航到 Azure Active Directory-> 您的应用程序),然后为您的租户单击grant

在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Microsoft Graph API的增量OAuth同意 - Incremental OAuth consent with Microsoft Graph api 在 Microsoft Graph API 中,具有管理员同意的应用能否为与批准它的管理员不同的用户生成令牌? - In the Microsoft Graph API, can an app with admin consent generate a token for a different user than the admin that approved it? 如何获得适用于Graph API端点和Outlook REST端点的管理员同意? - How to get admin consent working both for Graph API endpoint and Outlook REST endpoint? 如何实施Office365 API的管理员同意和用户同意 - How to implement admin consent and user consent for Office365 API Microsoft Graph API无法使用mail.read - Microsoft Graph API not able to use mail.read 多租户微软图形应用程序管理员同意,无需代码回发 - Multitenant microsoft graph app admin consent without code postback 通过Microsoft团队机器人团队用户配置文件图像访问 - Teams user profile image access via Microsoft teams bot 尝试在microsoft graph api中为用户信息兑换令牌时出现问题 - problem when trying to redeem the token for user information in the microsoft graph api 用于访问用户 OneDrive 的 Microsoft Graph API 代码库解决方案 - Microsoft Graph API code-base solution to access a user OneDrive 如何在通过微软图形 API 在 Outlook 联系人中创建/保存联系人时获得相同的 lastModifiedDateTime - How to get same lastModifiedDateTime when creating/saving contacts in outlook contacts through microsoft graph api
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM