firebase-admin-python | Firebase Admin Python SDK | Authentication library
kandi X-RAY | firebase-admin-python Summary
kandi X-RAY | firebase-admin-python Summary
Firebase provides the tools and infrastructure you need to develop apps, grow your user base, and earn money. The Firebase Admin Python SDK enables access to Firebase services from privileged environments (such as servers or cloud) in Python. Currently this SDK provides Firebase custom authentication support. For more information, visit the Firebase Admin SDK setup guide.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Updates a user
- Perform a HTTP request
- Make a request to the API
- Append a character to the buffer
- Returns a list of users
- Update OOC provider configuration
- Validate URL
- Validate OIDC provider ID
- Validate value
- Creates a SAML provider configuration
- Updates a SAML provider configuration
- Creates an OOC provider configuration
- Sends a list of messages
- Update an OOC provider configuration
- Update a user
- Deletes multiple users
- Create a session cookie
- Verify a session cookie
- Update SAML provider configuration
- Start a asyncio asyncio asyncio Eventloop
- Make a request
- Create a new OOC provider configuration
- Send a multicast message
- Import users
- Updates a tenant
- Create a new user
firebase-admin-python Key Features
firebase-admin-python Examples and Code Snippets
Community Discussions
Trending Discussions on firebase-admin-python
QUESTION
We have switched from Keycloak authentication to Firebase authentication and I need to migrate the users from Keycloak to Firebase using Python. These users were stored by Keycloak in a Postgres DB. I used the Admin SDK to get the users out of the Postgres DB and have already successfully saved them to Firebase, using the instructions from Firebase: https://firebase.google.com/docs/auth/admin/import-users. The users are also successfully created and displayed in Firebase. The users who logged in with the identity provider like Google Auth. can log in without problems. Only those users who log in with email and password get an error message INVALID_PASSWORD, CODE:400. My guess then was that the salt and/or hash are not passed correctly or that they are stored wrong (keycloak hashing alg.:pbkdf2_sha256 and iterations: 27500 (default value)). When passing in Python to the firebase attributes: password_hash and password_salt a byte array is expected, which I convert with bytes(user.password_hash/.password_salt, encoding='utf-8') to a byte array. In some posts (like https://github.com/firebase/firebase-admin-python/issues/182) I saw that I should decode the hash in base64 and after that it should already work.
...ANSWER
Answered 2021-Aug-03 at 06:42"If the salt is stored as a base64 encoded string, you have to decode that before passing it to Firebase. The code above only seems to decode the password hash." hiranya911
following code worked as expected:
QUESTION
The python firebase admin SDK isn't installing on Apple Silicon/M1. I've tried fixes in other posts here and on Github and they haven't worked. It's unclear to me if they work for anyone.
Installation ProblemThe command pip install firebase-admin
fails when it tries the setup script for the grpico package, which is a dependency of firebase.
I've tried the install with python 3.8.2, 3.9.4, and 3.9.5. All the versions failed. I've tried it inside a venv and globally, both failed.
My understanding of what's going on so far is:
- grpico is a dependency of firebase-admin (version 5.0.0), so
pip install firebase-admin
will try to install grpico (version 1.38.0) - grpico is only compiled for x86, so upon trying the setup steps for grpico, something (pip maybe) starts running a bunch of
clang
commands, attempting to compile a version for arm. - Some part of the compile fails and spits out a crazy looking error.
ANSWER
Answered 2021-Jun-29 at 20:37After reading every crazy guide on how to install grpcio, I was able to get it working with only two steps.
- Set 2 environment variables to tell the setup script to do something different. Run the following commands in terminal:
export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1
export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1
What do these ENV vars do? Who knows. No one has bothered to explain or communicate around this issue at all. Classic.
- Run
pip3 install firebase-admin
. This worked for me.
QUESTION
I have a celery task that sends messages to my client via firebase-admin. In development I used to send notifications like this and it all worked fine (my React-Native app received messages both in foreground and in background as expected):
...ANSWER
Answered 2020-Jun-17 at 14:35The sample you found send the message to a topic, which is a named key that clients can subscribe to. So no token is needed to send here, as it's a public/subscribe delivery system.
If you want to deliver to a specific token, replace the topic
key with token
as shown in this example from the documentation on sending messages to specific devices:
QUESTION
I'm struggling to find an answer on if Firebase Cloud Messaging supports sending notifications to Device Groups in the v1 HTTP API.
According to the migration documents, sending to device groups is supported.
Caution: Any apps that use device group messaging must continue to use the legacy API for the management of device groups (creating, updating, etc.). The HTTP v1 can send messages to device groups, but does not support management.
The important part being "HTTP v1 can send messages to device groups"
I'm using the firebase-admin-python
SDK, and when sending a single or set of batch messages I get a successful response, but the push notification does not send.
Is sending to device groups actually supported by the SDK in the same way that firebase_admin.messaging.send
and firebase_admin.messaging.send_all
are? The statement above leads me to believe that they are, but pushes aren't delivering (they do deliver when using the older legacy FCM API)
ANSWER
Answered 2020-Feb-13 at 21:21I assume you mean the token
parameter. There's no sparameter named to
on Message
.
The documentation you're quoting is for the HTTP v1 API. And it might very well support sending to device groups -- although I haven't been able to find any examples to confirm that. But I know for sure that the SDKs (all expect the Node.js SDK) neither expose nor support any functionality for sending to device groups. Docs at https://firebase.google.com/docs/cloud-messaging/send-message outline all the different ways you can send a message using the Python SDK, and it makes no mention of sending to device groups. The Message.token
parameter must be given an individual device registration token.
It is however rather strange that the FCM backend does not return an error when passing a device group key as the token. I'd recommend reporting a bug for that.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install firebase-admin-python
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page