有一个React应用通过GoogleAuthProvider运行Firebase身份验证。确认提供的范围,在回调中收到的auth对象的access_token
属性下的refresh_token
和stsTokenManager
可用。
我目前正在设置授权的API访问权限云功能,以列出目标用户的日历事件。
已授予的access_token,refresh_token和oAuth Client(应用程序)密钥。
const oauth2Client = new google.auth.OAuth2(
keys.client_id,
keys.client_secret,
keys.redirect_uris[0]
);
oauth2Client.setCredentials({
access_token,
refresh_token,
})
function calendar(auth) {
const calendar = google.calendar({
version: 'v3',
auth
})
calendar.events.list({
calendarId: 'primary',
})
///
错误响应为invalid_grant
Firebase npm JS模块是否在身份验证流程中提供access_type: 'offline'
?
身份验证流程变通方法(例如,将流程移至功能上)会有所帮助吗?