Add support for MS Graph to getCallbackTokenAsync in office-js Outlook API

Add support for MS Graph to getCallbackTokenAsync in office-js Outlook API
3

Upvotes

Upvote

 Apr 19 2021
0 Comments 
New

The office-js API for add-ins provides a method to get a token that can be used for authorization on EWS or Outlook REST API calls - getCallbackTokenAsync.

https://docs.microsoft.com/en-us/javascript/api/outlook/office.mailbox?view=outlook-js-1.9&preserve-view=true#getCallbackTokenAsync_options__callback_

 

This integration is convenient for add-ins looking to utilize these APIs to obtain more information for the add-in about current email. It avoids forcing additional UI interaction onto the user to authenticate, especially since they will be using the add-in from an already signed in location so a second sign in may create confusion (OWA, Outlook Desktop).

 

Request is to add support for generating tokens that can be used to call MS Graph to this method. Currently to achieve the same UI less authorization you would need to follow the SSO implementation instructions of creating a server that can obtain the authorization token for MS Graph when passed the access token the add-in can retrieve. However this adds additional technical overhead and complexity for an add-in used across multiple organizations as it would be necessary to create infrastructure for users to register and manage the client secret with the server once they configure the Azure application. It would be convenient to instead supports an 'isMsGraph' flag on getCallbackTokenAsync, the add-in then proceeding to issue Graph API calls.

Similar Ideas
No similar ideas