Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

282
Views
Realtime FireBase Database rules - where is auth.token located in a fetch request?

I wanted to know where a auth.token variable is located on a normal js fetch request.

For example, I have these rules:

{
  "rules": {
    ".read": "auth.token=='tokenhere'",
    ".write": "auth.token=='tokenhere'",
  }
}

Like a simple password system,

now I wanted to know where that auth.token would go in a fetch request in order to succeed these rules.

Thanks!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can't pass along custom information to the security rules. The only things available in your rules are:

  1. The path that the user is reading from or writing to.
  2. The data that the user is writing, if this is a write operation.
  3. The auth variable, if there is an authenticated user.

So if you want to test anything in your security rules, it'll have to be in one of these fields.

For example, if I want to store data that can only be accessed if the user knows some specific secret (like a password), I typically encoded that secret into the path to that data.

{
  "rules": {
    "correcthorsebatterystaple": {
      ".read": true,
      ".write": true,
    }
  }
}

With the above rules the user can only read/write the data if they somehow know the secret "correcthorsebatterystaple" value.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!