最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Outlook Add-In: Replacing Office.context.mailbox.getCallbackTokenAsync with Office.auth.getAccessTokenAsync Fails to Validate Ma

programmeradmin1浏览0评论

I am working on an Outlook Add-In where I want to access the Microsoft Graph API. I am trying to replace the following code:

function getAccesToken(callback) {
  Office.context.mailbox.getCallbackTokenAsync({ isRest: true }, callback);
}

With:

function getAccesToken(callback) {
  Office.auth.getAccessTokenAsync({ forceConsent: false }, function(result) {
    if (result.status === "succeeded") {
      callback({ status: "succeeded", value: result.value });
    } else {
      callback({ status: "failed", error: result.error });
    }
  });
}

In order to use Office.auth.getAccessTokenAsync, I updated my manifest.xml to include the element as follows:

<VersionOverrides xmlns="; xsi:type="VersionOverridesV1_0">
  <Requirements>
    <bt:Sets>
      <bt:Set Name="Mailbox" MinVersion="1.3" />
    </bt:Sets>
  </Requirements>
  <Hosts>
    ......
  </Hosts>

  <Resources>
    ......
  </Resources>

  <WebApplicationInfo>
    <Id>Your-App-Client-ID</Id>
    <Resource>api://Your-App-Client-ID</Resource>
    <Scopes>
      <Scope>Mail.ReadWrite</Scope>
      <Scope>Mail.Send</Scope>
    </Scopes>
  </WebApplicationInfo>
</VersionOverrides>

Problem: When I try to upload my manifest file, I receive the following error:

Upload failed. Please check the manifest file and try again.

What I've Tried:

  1. Double-checked that is placed within .
  2. Verified the Id matches my Azure AD App Registration's Application (client) ID.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论