Firebase security rules cross project

感情迁移 提交于 2021-01-29 04:04:14

问题


Project A has Firebase Authentication and Project B has Firebase Firestore. Both Authentication and Firestore are working correctly using: https://firebase.google.com/docs/projects/multiprojects (Web)

However when writing the following Project B Firestore Security Rules:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /users/{uid} {
      allow get: if request.auth.uid == uid;
    }
  }
}

I get an error:

Missing or insufficient permissions

Because the Authentication data is with Project A, there is no auth with the Project B Firestore request.

How do I give Project B the authentication information from Project A using JavaScript/Web?

来源:https://stackoverflow.com/questions/62367603/firebase-security-rules-cross-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!