6

My app has no individual users, instead it has some data that is generated by clients and can be seen by others, like public chat channel, usernames are also temporary.

I do not need every user account data to be authenticated. Instead only that if request is from my app, it should be served otherwise not. I see there is user authentication, but it means I have to keep the track of uids etc which also adds to data storage, other option is if I remove auth (set read/write public) and call data changes from my app.

Can I use app secret feature that is used by servers in my android app, if so how? This is rule for a server:

{
  "rules": {
    ".read": true,
    ".write": "auth.uid = 'myserver'"
  }
}

How can I make it work for my android app?

How my app is insecure without authentication (setting read/write public) , when only I know the url and only my package is configured from android app option on the server?

Is there any method other than user authentication that I can use which guarantees data security ?

4
  • You could use OAuth2 Client Credentials Flow
    – Héctor
    Jun 21, 2016 at 11:30
  • Where is firebase Oauth2 api? I am still getting to implement social sites accounts when I searched about oauth2 in firebase. Can you provide me a link for this topic?
    – Talha
    Jun 21, 2016 at 12:01
  • Did u manage to solve this? I'm also interested Apr 5, 2017 at 16:32
  • Not yet. Only solution seem to me is to create an authentication server then create and verify some unique keys between Firebase and the client.
    – Talha
    Apr 5, 2017 at 19:03

1 Answer 1

1

I know it's been a few years since you asked this, but I wanted to let you know that this is now finally possible.

Thanks to a new feature called Firebase App Check, it is now actually possible to limit calls to your Realtime Database to only requests coming from iOS, Android and Web apps that are registered in your Firebase project.

You'll typically want to combine this with the user authentication based security offered by security rules, so that users can only do what they're authorized to do. But in your case, just App Check might be/have been enough.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.