Comments (3)
As mentioned in my response on the Google group, you need to follow the instructions at https://google-auth.readthedocs.io/en/latest/user-guide.html#the-app-engine-standard-environment
(specifically the bit regarding the requests-toolbelt library)
from firebase-admin-python.
This helped me:
https://groups.google.com/forum/#!topic/firebase-talk/FzEG2U6SRN8
I solved with requests-toolbelt module, which is described in
https://stackoverflow.com/questions/9604799/can-python-requests-library-be-used-on-google-app-engine
pip install -t lib/ requests-toolbelt and below code in appengine_config.py:
import requests
import requests_toolbelt.adapters.appengine
# Use the App Engine Requests adapter. This makes sure that Requests uses
# URLFetch.
requests_toolbelt.adapters.appengine.monkeypatch()
# also monkey patch platform.platform() from https://code.google.com/p/googleappengine/issues/detail?id=12982
import platform
def patch(module):
def decorate(func):
setattr(module, func.func_name, func)
return func
return decorate
@patch(platform)
def platform():
return 'AppEngine'
from firebase-admin-python.
A critical piece of this is that, when using firebase, you must import firebase modules after monkeypatching, like this:
import requests
import requests_toolbelt.adapters.appengine
requests_toolbelt.adapters.appengine.monkeypatch()
# Now that we've imported requests, the toolbelt, and finished monkeypatch(), we can import firebase:
from firebase_admin import auth, initialize_app # This must go after the monkeypatch()
from firebase-admin-python.
Related Issues (20)
- [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 6
- [FR] Change the firestore db in firestore.client. HOT 1
- Datastore emulator causes firebase admin to hang HOT 2
- Realtime Database Listener Crashes on Internet Disconnection HOT 1
- Better Error handling for empty token list in Messaging send_each_multicast HOT 1
- Documentation: API Reference not available HOT 1
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.