问题
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