我需要了解如何将基于角色的身份验证与 firebase 云功能结合使用。我正在尝试使用express.js 来查找。如果您有任何明确的文档、git 存储库、任何来源的链接 - 请与我分享。
我认为您想使用管理 SDK 检查来电
role
的 https
?
如果我理解正确,那么下面是使用 custom-claim ,
的代码块// Verify the ID token first.
getAuth()
.verifyIdToken(idToken)
.then((claims) => {
if (claims.admin === true) {
// Allow access to requested admin resource.
}
});
请参阅 custom-claims#set_and_validate_custom_user_claims_via_the_admin_sdk