Office (JS) Outlook addin and Exchange token authentication
My Office add-in (which runs in Outlook) uses the OfficeJS library to get a callback token for authentication against Exchange: Office.context.mailbox.getCallbackTokenAsync(...); The token is sent to our server together with some message/attachment IDs and the server will attempt to connect to Exchange to retrieve said mail attachment. I use the EWS java API library for this. I am getting an Unauthorized 401 HTTP error back from Exchange when trying to bind to an EmailMessage: ExchangeService exchangeService = new ExchangeService(); exchangeService.getHttpHeaders().put("Authorization", "Bearer