与 google 助手关联的帐户未在申请请求中获取 accessToken

Account Linking with google assistant not getting accessToken in apprequest

我在 google 操作中实现了帐户链接。我选择了隐式链接类型的 OAuth。我已关联我的帐户,但在后续调用中没有获得访问令牌。在 google 文档中说:“在 Google 为您的服务获取访问令牌后,Google 会将令牌附加到后续对您的操作的调用中,作为 AppRequest 的一部分。”请求中的用户信息格式如下:

{
user : {
  "idToken": string,
  "profile": {
    object (UserProfile)
  },
  "accessToken": string,
  "permissions": [
    enum (Permission)
  ],
  "locale": string,
  "lastSeen": string,
  "userStorage": string,
  "packageEntitlements": [
    {
      object (PackageEntitlement)
    }
  ],
  "userVerificationStatus": enum (UserVerificationStatus)
}
}

google 请求格式:https://developers.google.com/assistant/conversational/df-asdk/reference/webhook/rest/Shared.Types/AppRequest#User.FIELDS.access_token

但我收到的请求不包含任何 accessToken。

{
user:
   { locale: 'en-GB',
     params: {},
     accountLinkingStatus: 'LINKED',
     verificationStatus: 'VERIFIED',
     packageEntitlements: [],
     lastSeenTime: '2020-11-09T09:07:54Z' }
} 

google 账户链接文档:https://developers.google.com/assistant/identity/oauth2?oauth=implicit#flow

我在应用请求的 header 中找到了访问令牌

授权:'Bearer < accesstoken > '

headers:
   { host: '5cf1a2690f0c.ngrok.io',
     'user-agent': 'Google-ActionsOnGoogle/1.0',
     'content-length': '885',
     'accept-encoding': 'gzip,deflate,br',
     authorization: 'Bearer < accesstoken >',
     'content-type': 'application/json;charset=UTF-8',
     'google-actions-api-version': '3',
     'google-assistant-signature':
      '< google-assistant-signature >',
     'x-forwarded-for': '66.249.84.212',
     'x-forwarded-proto': 'https' }

根据文档,它将以以下格式位于 body 部分,但我在 header.

中找到了它
{
user : {
  "idToken": string,
  "profile": {
    object (UserProfile)
  },
  "accessToken": string,
  "permissions": [
    enum (Permission)
  ],
  "locale": string,
  "lastSeen": string,
  "userStorage": string,
  "packageEntitlements": [
    {
      object (PackageEntitlement)
    }
  ],
  "userVerificationStatus": enum (UserVerificationStatus)
}
}