I am building a mobile application on Flutter and have integrated a Firebase login to the application. I also have a Python Django REST API that is called within the app. I am hoping to integrate Firebase with the REST API so that the users in Firebase can become authenticated users of the API (and so I can create tokens and tokenize the API endpoint).
Does anyone know of a method I can use for this? Novice programmer and new to Firebase so let me know if there is a better way to do this! Appreciate the help.
We can use any Firebase Realtime Database URL as a REST endpoint. All we need to do is append . json to the end of the URL and send a request from our favorite HTTPS client.
You can upload dynamic or static content on firebase, in the case of a Django app it's dynamic but your stylesheets / scripts are static content. Then in your server you have to specify that all the static files are stored in the above path.
Django REST framework is a powerful and flexible toolkit for building Web APIs. Some reasons you might want to use REST framework: The Web browsable API is a huge usability win for your developers.
The Firebase docs explain this well, if you check out the following URL: https://firebase.google.com/docs/auth/admin/verify-id-tokens . I started a Django app to handle this myself which you can download from PyPi: drf-firebase-auth, which you can either use yourself or fork the repo and adjust as suitable to your needs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With