I currently have two Firebase projects. One has the main database, an angular entry tool web app (used internally that fills the database), and two mobile apps that read from that database (currently have authentication in this project set up for the mobile apps users). The other project is blank and is thought to be used for authentication for the internal entry tool web app only .
I don't know if this is the best route. However, if so how do I connect the Entry Tool Auth Project to the Main Project? Especially if I'm not creating any apps within the Entry Tool Auth since it's only used for authentication?
Thanks!
If the data entry app is writing data to the main project, it should authenticate its users against that main project. There is no need to add a second project to the mix, and in fact doing so is what complicates things.
If you only want certain users to be able to use the data entry app, you can keep a list of those user's UIDs in the database and then check in both the code and security rules against that list.
Database
allowedDataEntryUsers: {
"uidOfUser1": true,
"uidOfUser2": true
}
Rules:
{
"rules": {
"allowedDataEntryUsers": {
".read": true,
".write": false
},
"data": {
".read": true,
".write": "root.child('allowedDataEntryUsers').child(auth.uid).exists()"
}
}
}
So:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.