Reputation: 2417
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
Reputation: 11
Microsoft recently addressed this with Nested App Authentication: https://devblogs.microsoft.com/microsoft365dev/new-nested-app-authentication-for-office-add-ins-legacy-exchange-tokens-off-by-default-in-october-2024/
Upvotes: 0