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

Suraj Sinha 10 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.  
Microsoft 365 and Office | Development | Other
Outlook | Windows | Classic Outlook for Windows | For business
Microsoft 365 and Office | Install, redeem, activate | For business | Windows
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Anonymous
    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 10 Reputation points
    2024-11-13T06:57:54.2933333+00:00

    Hi @Anonymous

    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.