Search code examples
iosmacosrestfirebasewatchos

How to handle authentication when creating an app that uses Firebase REST


I'm trying to create an application that needs to use a backend. That backend will be used to sync an app created (initially) for iOS, macOS, watchOS. Hope to expand after.

Firebase looks like a nice tool to do that, but it only has so many SDK's. I'd like to unify the codebase as much as possible to utilize code reuse.

Seems like their REST API is the way to go: I just create a framework using REST and we're off: https://firebase.google.com/docs/database/rest/start

However, their authentication doesn't seem to support REST.

How do I get around this limitation? What should I do to get a valid auth token that Firebase will understand?

Please keep in mind that I'm not very experienced with web stuff and even after reading a lot of articles, I'm still confused about how to exactly approach this. For example, this user had a similar concern, but I'm not exactly understanding the answer.


Solution

  • Firebase now officially supports REST API:

    https://firebase.google.com/docs/reference/rest/auth/

    You can query the Firebase Auth backend through a REST API. This can be used for various operations such as creating new users, signing in existing ones and editing or deleting these users.