Dave
Dave

Reputation: 2417

Call Microsoft Graph API directly from Outlook add-in

I have a React-based SPA Outlook add-in, and I am trying to make calls directly to the Microsoft Graph API.

Is there a way to utilize Office.context.mailbox.getCallbackTokenAsync() or Office.context.auth.getAccessTokenAsync() to get an AccessToken to call the Graph API directly from the Add-in?

As best I can tell, getCallbackTokenAsync() will let me call the Outlook REST API's directly (I ran into the issue of having scoped tokens because my manifest Permission was not set to ReadWriteMailbox), and the SSO token provided by getAccessTokenAsync() will only work if I pass it to a server somewhere to run a "on behalf of" OAuth request.

I'd prefer to not have to proxy all of my Graph requests through a server via the SSO flow, but as of now, that is the only solution I see.

Upvotes: 5

Views: 651

Answers (1)

Related Questions