0
votes

We have a mailapp addin implemented. We have encountered a strange error if we installed the addin in mailbox, which is in Excahnge 2016. There is some problem with EWS requet. We are using office.js to make request to exchange 2016.

makeEwsRequestAsync(data, callback, [userContext])

The above method is used to communicate with exchange. So if mailapp is installed on Exchange 2016 and we request some additional properties from email via above function we receive an asyncResult object with error:

  • error code: 9020
  • message: Remote server returned an error: (401 Unauthorized)

In documentation there is a note that in exchange the OAuth should be enabled.

NOTE: The server administrator must set OAuthAuthentication to true on the Client Access Server EWS directory to enable the makeEwsRequestAsync method to make EWS requests

We have checked this setting and it is set up. What else should we check? Any suggestion?

1
Can you provide some more details? What client are you testing this from (Outlook Web Access, Outlook Desktop, etc.) What version number of that client are you on? On the server side, what version of Exchange 2016? Is it On Prem or Office365? By any chance do you have different internal/external EWS urls? - Outlook Add-ins Team - MSFT
@OutlookWebAddinsTeam I going to collect all info, what you requested. However it is a customer On Prem installation so it will take time to gather all info from them. Till that I can say that we have checked it on OWA. Your last question is interested. Is there any problematic part if customer has different internal/external EWS url? (It might happend that it is true.) Those urls should be same? What are the requirements for mailapp if we are using makeEwsRequestAsync method? Thx - thadam
There was a known / fixed issue with Exchange servers that have different internal/external EWS urls. (it was fixed in December of 2016), that would cause these calls to fail. Having different internal/external URLs is pretty uncommon nowadays, if an exchange server still has these settings it's usually because it was left over from when having them different made a difference. - Outlook Add-ins Team - MSFT
@OutlookWebAddinsTeam I have received some information regarding to the environment. - Tested client: OWA - It is an On Prem Exchange - On the server side there is a Exchange 2016 cu3 installed - External and internal EWS URLs are the same Can you provide me a download link for Exchange 2016 cu3 update? We did not find anywhere that version and we would like to investigate the case internally. Thx. - thadam

1 Answers