admin.auth().verifyIdToken(tokenId)
.then((decoded) => res.status(200).send(decoded))
Run Code Online (Sandbox Code Playgroud)
我了解verifyIdToken()可以从Firebase身份验证客户端验证用户ID令牌.但是,我们需要通过确保数据库查询受到为令牌中标识的用户定义的数据库安全规则的限制来保护我们的云功能.鉴于admin SDK默认具有无限制访问权限,如何限制其对经过身份验证的用户的访问权限?
javascript firebase firebase-authentication firebase-realtime-database google-cloud-functions