Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Nest device access 授权设备访问时没有刷新令牌_Nest Device Access - Fatal编程技术网

Nest device access 授权设备访问时没有刷新令牌

Nest device access 授权设备访问时没有刷新令牌,nest-device-access,Nest Device Access,我可以通过Partner Connections Manager成功授权用户,但当我从https://www.googleapis.com/oauth2/v4/token使用我的授权码,我在响应中没有收到刷新\u令牌,只有访问\u令牌存在: { access_token: 'my-access-token', expires_in: 3599, scope: 'https://www.googleapis.com/auth/sdm.service', token_type: 'B

我可以通过Partner Connections Manager成功授权用户,但当我从
https://www.googleapis.com/oauth2/v4/token
使用我的授权码,我在响应中没有收到
刷新\u令牌
,只有
访问\u令牌
存在:

{
  access_token: 'my-access-token',
  expires_in: 3599,
  scope: 'https://www.googleapis.com/auth/sdm.service',
  token_type: 'Bearer'
}

确保在合作伙伴连接管理器(PCM)URL中指定
access\u type=offline
。省略它假定
access\u type=online
,它不提供刷新令牌

例如,PCM URL应该如下所示,其中
access\u type=offline

https://nestservices.google.com/partnerconnections/project-id/auth?
  redirect_uri=my-redirect-uri&
  access_type=offline&
  prompt=consent&
  client_id=my-client-id&
  response_type=code&
  scope=https://www.googleapis.com/auth/sdm.service
然后,来自
https://www.googleapis.com/oauth2/v4/token
应该具备您所期望的:

{
  "access_token": "my-access-token",
  "expires_in": 3599,
  "refresh_token": "my-refresh-token",
  "scope": "https://www.googleapis.com/auth/sdm.service",
  "token_type": "Bearer"
}
有关更多信息,请参阅设备访问网站上的