The bounty expires in 2 days. Answers to this question are eligible for a +50 reputation bounty.
lesolorzanov is looking for an answer from a reputable source:
It must be a real answer, not spam to farm reputation. It should contain a link to a reasonable source, and a recent source as this problem is very new and may be linked to changes in Google's terms.
Up until recently I was able to run queries with the Firebase SDK using Node.js. Now, however, I get an error indicating that the ACCESS_TOKEN_EXPIRED despite having created a new key with no expiration.
My Firebase settings display the following:

I generated my key in JSON format and added it as shown in the instructions:
var admin = require("firebase-admin");
const serviceAccount = require('pathtomykey.json');
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
databaseURL: "https://projectid-default-rtdb.firebaseio.com"
});
However, I continue to receive this error:
node:internal/process/promises:288
triggerUncaughtException(err, true /* fromPromise */);
^
Error: 16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.
{
code: 16,
details: 'Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.',
metadata: Metadata {
internalRepr: Map(4) {
'google.rpc.errorinfo-bin' => [
Buffer(125) [Uint8Array] [
10,
... 25 more items
]
],
'grpc-status-details-bin' => [
Buffer(385) [Uint8Array] [
... 285 more items
]
],
'www-authenticate' => [ 'Bearer realm="https://accounts.google.com/"' ],
'x-debug-tracking-id' => [ '19025914238;o=1' ]
},
options: {}
},
statusDetails: [
ErrorInfo {
metadata: {
method: 'google.firestore.v1.Firestore.RunQuery',
service: 'firestore.googleapis.com'
},
reason: 'ACCESS_TOKEN_EXPIRED',
domain: 'googleapis.com'
}
],
reason: 'ACCESS_TOKEN_EXPIRED',
domain: 'googleapis.com',
errorInfoMetadata: {
method: 'google.firestore.v1.Firestore.RunQuery',
service: 'firestore.googleapis.com'
}
}
I have tried being logged in with my administrator account as well as using a service account. This setup used to work until last year, and I’m uncertain what might be causing the issue now. Can someone help shed light on this?