I'm in the process of switching my application's authentication from django to firebase auth. My djangae application uses the Firebase Admin SDK for Python.
When I first deploy my GAE application (or update it), I can succesfully make Firebase Admin calls on the Auth component, such as get_user or get_user_by_email. But after a while, perhaps 30 or 60 minutes (not sure exactly), these calls start failing with a NotAllowed exception coming from app identity (Default Application Credentials). The stack trace is pasted below.
I've submitted a GCP support ticket about it. But I'm also wondering if it's possibly an issue from using App Engine SDK 57, which djangae is now stuck at.
Has anyone else encountered this problem?
----
File "/base/data/home/apps/s~f/1.415261650055915972/sitepackages/prod/firebase_admin/auth.py", line 252, in get_user_by_email
response = user_manager.get_user(email=email)
File "/base/data/home/apps/s~f/1.415261650055915972/sitepackages/prod/firebase_admin/_user_mgt.py", line 397, in get_user
response = self._client.request('post', 'getAccountInfo', json=payload)
File "/base/data/home/apps/s~f/1.415261650055915972/sitepackages/prod/firebase_admin/auth.py", line 513, in request
resp = self.session.request(method, self.ID_TOOLKIT_URL + urlpath, **kwargs)
File "/base/data/home/apps/s~f/1.415261650055915972/sitepackages/prod/google/auth/transport/requests.py", line 198, in request
self._auth_request, method, url, request_headers)
File "/base/data/home/apps/s~f/1.415261650055915972/sitepackages/prod/google/auth/credentials.py", line 122, in before_request
self.refresh(request)
File "/base/data/home/apps/s~f/1.415261650055915972/sitepackages/prod/google/auth/app_engine.py", line 118, in refresh
self._scopes, self._service_account_id)
File "/base/alloc/tmpfs/dynamic_runtimes/python27g/7e468a4e2dbc991a/python27/python27_lib/versions/1/google/appengine/api/app_identity/app_identity.py", line 605, in get_access_token
scopes, service_account_id=service_account_id)
File "/base/alloc/tmpfs/dynamic_runtimes/python27g/7e468a4e2dbc991a/python27/python27_lib/versions/1/google/appengine/api/app_identity/app_identity.py", line 558, in get_access_token_uncached
return rpc.get_result()
File "/base/alloc/tmpfs/dynamic_runtimes/python27g/7e468a4e2dbc991a/python27/python27_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", line 615, in get_result
return self.__get_result_hook(self)
File "/base/alloc/tmpfs/dynamic_runtimes/python27g/7e468a4e2dbc991a/python27/python27_lib/versions/1/google/appengine/api/app_identity/app_identity.py", line 529, in get_access_token_result
raise _to_app_identity_error(err)
NotAllowed