更新时间:2023-10-14 08:36:22
您必须通过 https://创建的必须创建的SSO(单点登录)应用程序apps.dev.microsoft.com .在此处创建融合应用程序-允许被许可方使用其Outlook.com帐户或组织帐户(较新的方式)登录.
The SSO (Single Sign on) app that you had to create, needed to be created through https://apps.dev.microsoft.com. This was where you create the converged apps - which allows the consented parties to sign-in with their Outlook.com accounts or the organizational accounts (which is the newer way).
但是EWS没有使用它. EWS使用的是较早的创建应用程序的身份验证方法,这是您需要通过Azure门户-通过AAD应用程序注册进行的操作.有关EWS身份验证的更多文档,请参见: https://docs.microsoft.com/zh-cn/exchange/client-developer/exchange-web-services/authentication-and-ews-in-exchange
However EWS is not using this. EWS is using the authentication method of older way of creating apps, which is what you need to do through Azure Portal - through AAD App registrations. More documentation on authentication of EWS here: https://docs.microsoft.com/en-us/exchange/client-developer/exchange-web-services/authentication-and-ews-in-exchange
因此,基本上,您检索到的OAuth访问令牌可用于查询Microsoft Graph(作为示例),但是您不能使用它来调用EWS.
So basically, the OAuth access token which you've retrieved can be used to query Microsoft Graph (as an example) but you can't use that to call EWS.
此创建的一个非常重要的区别是EWS(顾名思义,Exchange Web Services)仅是组织帐户.您不能为Outlook.com用户使用该API.
One very significant difference this creates is EWS is (as the name suggests, Exchange Web Services) is organizational accounts only. You can't use that API for the Outlook.com users.
makeEwsRequestAsync
方法.这将要求您使用JavaScript编写SOAP,但是它可以工作.makeEwsRequestAsync
method. This will require you to write SOAP in javascript but it works.