Office 365 / EWS Authentication using OAuth

后端 未结 3 1206
傲寒
傲寒 2021-01-01 06:17

I\'m trying to log onto Office 365 Exchange Online using OAuth and EWS Managed API.

I am able to use connect to the Office 365 Web API\'s (REST), so I do have a vali

3条回答
  •  再見小時候
    2021-01-01 06:56

    TokenCredentials is not the right class to use in this example. Like Jason mentioned put in place for other reasons. As a note and to clarify using this and/or SAML tokens will not work in Exchange Online with EWS. Only OAuth based access is supported. To make this work we put a OAuthCredentials class in EWS Managed API. In your code you can "var credentials = new OAuthCredentials(token)". Be aware that EWS Soap only supports full "user_impersonation" / "full access to the users mailbox" rights. Granular permission such as Calendar.Read are only available with EWS Rest APIs. While "Full mailbox access" requires an admin to consent, admins from other tenants can consent as it is a web app. In case you want to develop a native app, the app has to be directly registered in the app of the tenant it runs in order to use "Full mailbox access".

提交回复
热议问题