Giter Site home page Giter Site logo

Comments (6)

katowulf avatar katowulf commented on June 5, 2024 2

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:

  1. Have the client pass their current auth token and use verify_id_token
  2. 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)
  3. Utilize Functions, which provide built-in access to user identity in same triggers (e.g. RTDB events).

from firebase-admin-python.

hiranya911 avatar hiranya911 commented on June 5, 2024 1

@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.

firemanxbr avatar firemanxbr commented on June 5, 2024

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.

firemanxbr avatar firemanxbr commented on June 5, 2024

@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.

firemanxbr avatar firemanxbr commented on June 5, 2024

@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.

firemanxbr avatar firemanxbr commented on June 5, 2024

Perfect. Thanks for explain the flow recommended. I'll implement and test. Have a good one.

from firebase-admin-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.