How to request Microsoft Graph scope or any other custom scope using office API `Office.auth.getAccessToken()` in an Outlook Add-In?

Suraj Sinha 5 Reputation points
2025-02-18T12:49:59.48+00:00

I am developing a React.js-based Outlook add-in and using the Office.auth.getAccessToken() API to authenticate users. But I need to obtain an access token A with additional Microsoft Graph API scopes (e.g., Mail.Read, User.Read).

From my research, I understand that:

  • Office.auth.getAccessToken() provides an identity token (Token A) but does not allow specifying custom Graph API scopes.
  • The WebApplicationInfo section in the Outlook add-in manifest does not support defining additional Microsoft Graph permissions.
  • The recommended approach is to use MSAL.js separately to acquire a token (Token B) with the required Graph API scopes.

Question:

Is there any way to configure the WebApplicationInfo element or any other method to obtain Token A with Graph API scope or any other custom scope directly using Office.auth.getAccessToken()?

Office
Office
A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.
1,919 questions
Outlook
Outlook
A family of Microsoft email and calendar products.
4,504 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,102 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
4,277 questions
Outlook Management
Outlook Management
Outlook: A family of Microsoft email and calendar products.Management: The act or process of organizing, handling, directing or controlling something.
5,505 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.