Comments (6)
This is not intended to be used as a client library, but instead for privileged admin accounts. To verify clients making requests against your servers, there are a few common practices:
- Have the client pass their current auth token and use verify_id_token
- Have the client write to the Realtime Database and use security rules to verify authentication (don't allow write in not authenticated). Have the server listen on the path for adds and process the requests. (This is a great method for reducing your server stack, see firebase-queue)
- Utilize Functions, which provide built-in access to user identity in same triggers (e.g. RTDB events).
from firebase-admin-python.
@katowulf is right. The Admin SDKs do not support authenticating as end users (this is same across all languages we support; Node and Go don't support it either). The Admin SDKs should only be used in privileged environments, and therefore supports authenticating with service accounts and other types of Google Cloud credentials.
However, you claim that your workflow is something like the following:
MongoDB <=> Python API(Auth0) <=> Mobile App IOS/Android and Web. I run all services in GCP.
Now this is something Admin SDK supports. But you need to do the end user authentication in your mobile or web app, and pass the resulting ID token to the Python service. There, the admin SDK can call verify_id_token()
(as @katowulf mentioned), and then you can proceed to access the database on behalf of the user.
from firebase-admin-python.
Sorry but my goal is different that you mentioned above. I would like use the firebase as database for my API. I have an API created with Python + Flask + Auth0. In this API we use MongoDB as database. I found some alternatives using JavaScript and Python but this is not a good implementation in my opinion [1]. In that case Firebase can't used as Database to an API ? I would like use this library but I don't see much advantages in Firebase Auth if I can't use this with Python. My flow followin below:
MongoDB <=> Python API(Auth0) <=> Mobile App IOS/Android and Web. I run all services in GCP.
I can change from MongoDB and Auth0 to Firebase stack ?
[1] https://github.com/fthai-google/template-app/blob/master/main.py
from firebase-admin-python.
@katowulf your recommendations are JavaScript projects why I'll use JavaScript if have a SDK to Python ? this is a repository to Python not JavaScript if this is don't offer this access from Python maybe the Python community can't use Firebase. Maybe the good alternative is continue using the Auth0 service and MongoDB.
from firebase-admin-python.
@hiranya911 What are goal of this SDK if don't offer the same features of Node.JS and Go SDK ? I would like use Firebase in my Python APIs because have the Authentication and Database in the same service. Do you can provide any example or explain more. I'll create a post my blog about this SDK if works like Node and Go.
from firebase-admin-python.
Perfect. Thanks for explain the flow recommended. I'll implement and test. Have a good one.
from firebase-admin-python.
Related Issues (20)
- Transaction contextmanager does not set transaction to in_progress HOT 2
- python-jwt is deprecated HOT 2
- firebase_admin installed and got PyJWKClient issue HOT 2
- [FR] Download url like with node js client HOT 1
- Github Desktop Pull/Push Issue HOT 2
- [FR] Adding global var HOT 1
- Option to pass values to the transaction function callback HOT 1
- auth.verify_id_token throwing ValueError HOT 1
- [FR] Add Support for Pyodide by providing a wheel with binaries built for Emscripten. HOT 2
- [FR] Add WebApps support to project_management HOT 1
- Couldn't import app_check HOT 1
- Firebase functions container silently freezes on making a get request to Firestore if multiple requests were created before container starts HOT 3
- Call to Firestore getting timed out from the docker container. HOT 1
- Querying Firestore documents by nested key-value in an array field using Python HOT 1
- firestore times out when using default DNS resolver HOT 1
- [FR] Async `messaging` requests HOT 1
- import firebase admin HOT 3
- Using cloud run from gcp console to firebase HOT 1
- Cloud run from gcp console HOT 2
- [FR][FCM] HTTP2 support for sendEach HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firebase-admin-python.