Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.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
我可以使用GoogleAPI和通过Firebase身份验证获取的刷新\u令牌吗?_Firebase_Google Api_Firebase Authentication_Google Api Nodejs Client - Fatal编程技术网

我可以使用GoogleAPI和通过Firebase身份验证获取的刷新\u令牌吗?

我可以使用GoogleAPI和通过Firebase身份验证获取的刷新\u令牌吗?,firebase,google-api,firebase-authentication,google-api-nodejs-client,Firebase,Google Api,Firebase Authentication,Google Api Nodejs Client,我使用Firebase身份验证 firebase .auth() .getRedirectResult() .then(异步函数(结果){ if(结果凭证){ const{accessToken,idToken}=result.credential const{uid,refreshtToken}=result.user //保存到Firestore 等待firebase.firestore().collection('users').doc(uid) .设置( {accessToken,idT

我使用Firebase身份验证

firebase
.auth()
.getRedirectResult()
.then(异步函数(结果){
if(结果凭证){
const{accessToken,idToken}=result.credential
const{uid,refreshtToken}=result.user
//保存到Firestore
等待firebase.firestore().collection('users').doc(uid)
.设置(
{accessToken,idToken,refreshtToken},
{merge:true}
)
}
})

我使用FirebaseFunctions中的GoogleAPI。
代码就是工作

let oauth2Client = new google.auth.OAuth2(
  'my_client_key',
  'my_client_secret'
)
oauth2Client.setCredentials({
  access_token: accessToken,
  refresh_token: refreshToken
})

const calendar = google.calendar({ version: 'v3', auth: oauth2Client })
const result = await calendar.calendarList.list()
但是,当AccessToken过期时,它将不工作。
返回错误
无效\u授权

刷新\u令牌
似乎不起作用,我该怎么办


我尝试了
getAccessToken()
refreshAccessToken()
,但针对相同的…
无效\u grant
错误…

找到解决方案了吗?找到解决方案了吗?