O365 Outlook REST API,伪装 [英] O365 Outlook REST API, masquerading

查看:112
本文介绍了O365 Outlook REST API,伪装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们必须编写一个同步解决方案,该解决方案必须在O365中为最多4000个用户创建和更新日历事件.无法像每个用户一样进行身份验证,但是我发现的所有文档和示例都基于对当前用户的直接身份验证.

We must write a synchronisation solution that must create and update calendar events in O365 for up to 4000 users. It is impossible to authenticate as each user to do this, but all docs and examples I found are based on direct authentication as the current user.

从另一个我知道伪装的Calendar REST API中,我可以以管理员身份创建一个应用令牌,然后以另一个用户的身份伪造URI来创建事件.

From another Calendar REST API I know masquerading, there I can create a app token as Administrator, and then masquerade the URI as another user to create events.

但是,似乎Outlook/O365没有此功能.解决方案必须选择哪种方式?

But it seems that Outlook/O365 don't have this feature. Which way must I choose for the solution?

推荐答案

您实际上可以获得一个应用程序级别的令牌,该令牌将使您可以访问所有内容.

You can actually get an application-level token which will give you access to everything.

它涉及向应用程序添加应用程序级别的权限,然后使用具有管理员帐户的一次性oAuth登录名来向应用程序授予这些权限.

It involves adding application-level permissions to the app, then using a one-time oAuth login with an admin account which will give those permissions to the app.

然后,您可以使用oAuth客户端凭据身份验证过程来检索令牌,而无需进一步的用户交互(仅使用应用程序ID和密码).

You can then use the oAuth client credentials auth process to retrieve a token without further user interaction (just using the app id and secret).

所有详细信息都在这里: https://developer.microsoft .com/en-us/graph/docs/concepts/auth_v2_service

All the details are here: https://developer.microsoft.com/en-us/graph/docs/concepts/auth_v2_service

当然,像/me之类的东西将不再起作用,您必须访问特定的用户.

Of course, things like /me will no longer work, you'll have to access specific users.

注意:Outlook REST API,Office 365 REST API和Microsoft Graph之间的差异有很多混淆,但后者似乎是最新的.

Note: there's quite a bit of confusion around the differences between Outlook REST API, Office 365 REST API, Microsoft Graph, but the latter seems to be the most recent.

还有两种不同的注册应用程序的方法,如果要使用该过程,请确保使用上面文档中描述的方法.如果您使用Azure应用程序注册,则过程会稍有不同(在以上链接的文档的末尾进行了描述),但是最终结果应该相同.

There are also two different ways of registering apps, make sure you use the one described in the document above if you want to use that process. If you use the Azure app registration, the process is slightly different (described at the end of the above linked document), but the end result should be the same.

这篇关于O365 Outlook REST API,伪装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆