Office-js: Does the token from getCallbackTokenAsync also work for the Microsoft Graph API?

Created on 17 May 2018  路  8Comments  路  Source: OfficeDev/office-js

I'm experiencing 401 Authorisation errors when I pass on the token I retrieved from Office.context.mailbox.getCallbackTokenAsync()

Looking at your documentation it says it's for REST and Microsoft Exchange. So that doesn't say it's a token for Microsoft Graph API as well. Can you confirm here and probably improve documentation on this?

Thanks

Outlook

Most helpful comment

Given that the Outlook REST API and Microsoft Graph are often used interchangeably elsewhere in the documentation, I can see how this might not be immediately clear to developers.

Should this be noted in the Use the Outlook REST APIs from an Outlook add-in?

All 8 comments

The callback token does not work with Microsoft graph and we do not have plans to do so in near future. Please use AAD authenticated access token for Microsoft graph access. Callback token is intended to work for on-prem exchange configurations and it is only intended to give access to mailbox content while Microsoft graph has additional APIs as well which are some of the reasons it is not supported for Microsoft Graph.

Given that the Outlook REST API and Microsoft Graph are often used interchangeably elsewhere in the documentation, I can see how this might not be immediately clear to developers.

Should this be noted in the Use the Outlook REST APIs from an Outlook add-in?

Adding @Rick-Kirkham from documentation team, to handle the documentation side of things

@mlafleur is correct - I also have fallen into this assumption, and I wish I would have seen this issue last week as it could have saved me several days of banging my head against the desk. :-|

The update should be published next week. Please reopen if more clarification is needed. Thanks.

i am not getting the Access Token in my outlook addin. i am using office 365 account and outlook web.what would be the issue? could anyone please help

just want to give more information on issue, when i save the calendar event and open, i am getting the access token. is this the expected behavior? Won't i be able to get the token while composing as new? my add-in is for fetching the data before saving/send the appointment. please help

@Francis-B: Thank you for raising this issue. However, could you create a new issue as this one is already closed?

Was this page helpful?
0 / 5 - 0 ratings