Firebase database secrets

Database secrets are currently deprecated and use a legacy Firebase token generator. Update your source code with the Firebase Admin SDK.

I'm trying to save user-written data on firebase, following a lot of tutorials, but I found this message.

  1. Does this message mean that using "database secrets" will cause security problems?
  2. I'm also wondering if I can't release an app using "database secrets" on the Play Store.

I looked up the data and couldn't find a clear meaning for it. Please help. And if there is a solution, please let me know.

Ask yourself as to why you need to use database secrets? This shouldn't usually be required to store data on Firebase.

image

I use firebaseDB and it needs database secrets.

No, that is where you can put your project api key, although you do not have to.

Check this out to see where you can get that token from your firebase project and, if you don't have it, how to generate one.

image

When I use FirebaseDB, it doesn't run with the API key(Alza~~~). I've already found something that doesn't run with the API key, and I've found a way to use the "data secrets".

image

I already have the APIkey.
When I use FirebaseDB, it doesn't run with the API key(Alza~~~). I've already found something that doesn't run with the API key, so I've found a way to use the "data secrets".

The other thing you need to use firebase is the firebaseURL:

image

you can find it in:

image

Of course I tried it.

As already said, you do not need the API key or the database secrets token to connect the experimental Firebase component to the Firebase realtime database. You really would not want to use the Firebase secrets key because this would leave your data wide open.

Have you set any secure rules?

Here is an example:

Yes. This is my firebase rules. The users can save or get only their own data.

{ "rules": {
"fomo": {
"$uid": {
".read": "$uid === auth.uid",
".write": "$uid === auth.uid"
}
}
}
}

data secrets : works fine
the web api key : firebase permission denied

This is the problem. :smiling_face_with_tear:

I see you are not using the experimental firebase component...

Read all this:

then you will understand what to do.

In essence you use the authenticated user's idToken to provide access to the data, which means an authenticated user must sign in in order to return a valid idToken. There is also a refresh token mechanism which I have not covered in the guide above.

Using the database secret token is not recommended because this exposes your entire firebase!

See what @TIMAI2 has posted for you :point_up_2:

You can see your authenticated users in " Authentication" menu of firebase, with their user UIDs.

If don't need the authentication you can use firebase component.

Thank you for your continued response. The site you suggested is already in my bookmark, and I've read it dozens of times. It's one of the things I've tried but I failed to apply to my case.

I'm currently trying to use firebaseDB, as I did in the beginning.

This is how I want to do it. But when I apply this code, I get "permission denied." The weird thing is that there were times when I successfully uploaded data this way without any problems. It's weird that it's the same code, but it's a different result.

I'm still looking for help or relevant guides for my case.

The experimental firebase component is not designed to (and will not) work with secure rules.

Use the web component, or there are a couple of extensions that also use the Firebase Realtime Database REST api.

The experimental firebase component is not designed to (and will not) work with secure rules.

  1. Where can I find that information? I didn't know that. :smiling_face_with_tear:

  2. Can you tell me how to turn my list into a form for using web components? I've read and followed a lot of guides, but they all only provide short examples, so it doesn't work well in my case. How do I apply it if I already have a list form like myself?

Some examples:

(no rules used to return this)
image

As you can hopefully see, the list data is stored in firebase as a firebase array, and this is then returned as a stringified json array to the app (use the jsontextDecode block to convert back to an ai2 list)

1 Like

image

I tried based on what you told me.

Since idToken is applied to import values, it works well without permission denied. This method does not use data secrets, so it will be safer, right? :grin:

So far, other things work fine. Thanks to you, I learned something new. Thank you.