What value to set in <Resource> section in the "WebApplicationInfo" element in Outlook Add-In manifest for "Office.context.auth.getAccessToken".

Suraj Sinha 5 Reputation points
2024-11-12T10:35:23.4133333+00:00

This is to seek inputs on how to configure the "WebApplicationInfo" section in the manifest file of an Outlook Add-In.

  1. We have developed a ReactJS, web-based, Outlook Add-In, using Microsoft JavaScript Office APIs.
  2. The Outlook Add-In is hosted on the URL https://cmicpublish.cmicglobal.com/cmicdev/outlookplugin/.  
  3. The URL of the landing page of the Add-In being https://cmicpublish.cmicglobal.com/cmicdev/outlookplugin/taskpane.html.
  4. Now, we want to call the "Office.context.auth.getAccessToken" Office API, to retreive an authentication for calling Microsoft Graph APIs.
  5. For this, it is required to add a new "WebApplicationInfo" section in the manifest file of the Outlook add-in, like this:

https://learn.microsoft.com/en-us/javascript/api/manifest/webapplicationinfo?view=common-js-preview

<WebApplicationInfo>

<Id>12345678-abcd-1234-efab-123456789abc</Id>

<Resource>api://contoso.com/12345678-abcd-1234-efab-123456789abc</Resource>

<Scopes>

<Scope>Files.Read.All</Scope>

<Scope>offline_access</Scope>

<Scope>openid</Scope>

<Scope>profile</Scope>

</Scopes>

</WebApplicationInfo>

 

  1. Question For our case, as explained above, what should be the value in the <Resource> XML section.  
Office
Office
A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.
1,727 questions
Outlook
Outlook
A family of Microsoft email and calendar products.
4,047 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,306 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.
3,999 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Yakun Huang-MSFT 6,650 Reputation points Microsoft Vendor
    2024-11-13T02:12:01.9133333+00:00

    Hello Suraj Sinha,

    Thank you for reaching out to Microsoft Support!

    According to the documentation, the value of <Resource> is the Application ID URI of the add-in as registered in the Azure Active Directory v 2.0 endpoint.

    The Application ID URI is set when we register the application, as shown below, see the documentation for details.

    User's image

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.

    0 comments No comments

  2. Suraj Sinha 5 Reputation points
    2024-11-13T06:57:54.2933333+00:00

    Hi @Yakun Huang-MSFT

    What should we use for the Application ID URI?
    Should it be the URL where our Outlook add-in is hosted or the URL of any server-side API's?

    This question arises because we're unable to sideload manifest file if the Resource value is anything other than the URL where our Outlook add-in is hosted.

    In our case, the add-in is hosted at "https://cmicpublish.cmicglobal.com/cmicdev/outlookplugin" We can only sideload the add-in when the **WebApplicationInfo** element matches what’s shown in the snapshot; otherwise, installation get failed.
    User's image

    0 comments No comments

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.