使用 Firebase 用户对 Google Cloud 库进行身份验证

时间:2021-04-09 14:33:50

标签: firebase google-cloud-platform firebase-authentication

我有一个 Firebase 项目,其中用户已使用 Google Sign In 方法进行身份验证。他们还授予我访问 ...auth/content 范围的权限。

现在,我想通过 Google Cloud Library 在我的后端代码中代表他们执行一些操作。

我不知道如何正确初始化 google 客户端以使其有权执行某些操作。

    import { google } from "googleapis";

    const authUser = await adminApp.auth().getUser(`...`)
    const googleAuth = new google.auth.GoogleAuth({
        // ???? How can I init it with `authUser`?
    })
    // Acquire an auth client, and bind it to all future calls
    const googleClient = await googleAuth.getClient()
    google.options({ auth: googleClient });

有没有办法将 Firebase 身份验证与 Google Cloud node.js 库一起使用?

0 个答案:

没有答案