Is there any way to give access to particular node to some user without authentication?

Viewed 65

My firebase database looks like below:
enter image description here
Suppose I have 50 users and I want to give access to node code-1 to user 1-20, code-2 to user 21-40 and code-3 to user 41-50. I have some problem and I don't want to use firebase authentication. Is there any way to do so? like sending data from user to firebase and then complete checking in Realtime database rules section and then grant permission.

1 Answers

Two options come to mind:

  1. Security through obscurity: Rename code-1 to something unguessable like c17357345db9 and rename code-2 to 64af7b679319. Then share a link to an app that gives access to c17357345db9 to users 1-20, then share a different link for 64af7b679319 to users 21-40.

  2. Create an API Server: Don't allow direct access to the RTDB but instead create a Cloud Function that acts as a REST API to retrieve the data based on the user's ID.

Neither are optimal and user 3 could easily share access with user 30 if they wanted to.

Related