Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/342.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 从Google App Engine访问Firebase数据库_Python_Google App Engine_Firebase_Firebase Realtime Database - Fatal编程技术网

Python 从Google App Engine访问Firebase数据库

Python 从Google App Engine访问Firebase数据库,python,google-app-engine,firebase,firebase-realtime-database,Python,Google App Engine,Firebase,Firebase Realtime Database,我无法从GAE应用程序访问Firebase DB。它在本地运行时工作正常,但部署到GAE(*.appspot.com)时,我从Firebase返回了一个未经授权的错误。很可能我错过了一些显而易见的事情 这是我使用的_get_http()函数。它工作正常(在执行gcloud beta auth应用程序默认登录后) 我从Firebase得到的错误是: {u'error': u'Unauthorized request.'} GAE的日志包括以下内容: 11:14:43.835 Attempting

我无法从GAE应用程序访问Firebase DB。它在本地运行时工作正常,但部署到GAE(*.appspot.com)时,我从Firebase返回了一个未经授权的错误。很可能我错过了一些显而易见的事情

这是我使用的_get_http()函数。它工作正常(在执行
gcloud beta auth应用程序默认登录后)

我从Firebase得到的错误是:

{u'error': u'Unauthorized request.'}
GAE的日志包括以下内容:

11:14:43.835
Attempting refresh to obtain initial access_token
11:14:44.625
Refreshing due to a 401 (attempt 1/2)
11:14:44.966
Refreshing due to a 401 (attempt 2/2)

明白了!我已经把
注释掉了https://www.googleapis.com/auth/userinfo.email“
认为这是不必要的。错。再次启用它,宾果

11:14:43.835
Attempting refresh to obtain initial access_token
11:14:44.625
Refreshing due to a 401 (attempt 1/2)
11:14:44.966
Refreshing due to a 401 (attempt 2/2)