Problem with secure database in firebase never work

i spend week watch videos and read articles about this and its not work at all

Don’t use all capitals. That is like shouting and we don’t shout here. And please read this…

Only one point you need to keep in mind. Suppose if you set authorization, then you need to getID token whenever user sign up or login success.

After getting this ID you need to change the existing firebase token to this getID token then only the permission denied will not appear and you can write into the firebase successfully…

sorry i dont mean to shouting , i search it in google YouTube Facebook groups communities
i dont find my answer

please can you show me how ?
I just want to protect the data, but I didn’t know how because I am not very good at it
I do not mean here to be relying on you, but I really got a headache from this problem and I would like to offer me a picture or a way to do this

No issue. By the way what type of authentication you are using… Email or Google or phone

Google mean immediately I will show the block, if not I have to work it

actually i make simple login signup system without use the authentication (just username and password ) to sign in or sign up

Then it is very very simple… please wait for few minutes… I will give the block. After the lunch break I will solve your query meanwhile if you get solution from others I will be more happy :blush:

1 Like

thankyou very much man Take your time, I will be grateful to you

If you are changing rule, then authendicatiin only will work. Anyway let me try

look first time the both true
then i put it
read true
write false
but this not work because the points not change

then i put this (picture) and give me permission denied when i sign up or login

and give me permission denied

Yes, thas what i said earlier… If you are assigning or changing the default firebase rule to auth mode, then you should enable users to sign in/login or signup via firebase authentication only.

https://firebase.google.com/docs/database/security

what must i do now ? because i want to start publish my app ?
if i change it to locked mode it will work or what ?

then ? what must i do if i enable firebase authentication sorry for many questions :innocent:

this code written for another user but methods are almost same… Here also i am writing and reading firebase in a protected manner

here is the blocks for sign in via google with firebase protected mode… Have a look at it…

2 Likes

thankyou very much for your help and your time , i will try to add sign in via google and change my blocks i think this will take a long time for changes < again thankyou very much >

1 Like

yeah, definitely it will take time. Morever we cannot check up in companion mode, need to convert into apk so it will consume time… All the best…

1 Like

If you have multiple buckets in firebase realtime database you need to set rules for each buckets otherwise you will get the error “Permission denied”. If you can show me your database tree i can help write the rules.