firebase-admin-node icon indicating copy to clipboard operation
firebase-admin-node copied to clipboard

Access Token Expired Error with Firebase Admin SDK v12.3.1

Open tinyscratch opened this issue 1 year ago • 3 comments

I updated to the latest version of **"firebase-admin": "12.3.1" but am still getting this issue with authentication. The same code was working easier, correct. I read that this version refresh token issue is fixed, but i am still getting this issue. please let me know how to resolve this. i am not able to upload bulk data using a Node.js script

at Object. (/Users/tushar/Documents/codebase/Node/bulk-upload-script/bulk-upload-playlist-songs.js:107:1) at Module._compile (node:internal/modules/cjs/loader:1376:14) at Module._extensions..js (node:internal/modules/cjs/loader:1435:10) at Module.load (node:internal/modules/cjs/loader:1207:32) at Module._load (node:internal/modules/cjs/loader:1023:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12) at node:internal/main/run_main_module:28:49 { 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' => [Array], 'grpc-status-details-bin' => [Array], 'www-authenticate' => [Array], 'x-debug-tracking-id' => [Array] }, options: {} }, note: 'Exception occurred in retry method that was not classified as transient', statusDetails: [ ErrorInfo { metadata: [Object], reason: 'ACCESS_TOKEN_EXPIRED', domain: 'googleapis.com' } ], reason: 'ACCESS_TOKEN_EXPIRED', domain: 'googleapis.com', errorInfoMetadata: { service: 'firestore.googleapis.com', method: 'google.firestore.v1.Firestore.Commit' } }

tinyscratch avatar Aug 13 '24 15:08 tinyscratch

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

google-oss-bot avatar Aug 13 '24 15:08 google-oss-bot

Hey @jonathanedey, could this be related to https://github.com/firebase/firebase-admin-node/pull/2648?

lahirumaramba avatar Aug 22 '24 17:08 lahirumaramba

I don't think it should be unless Firestore use our internal getToken method before making their rpc call.

jonathanedey avatar Aug 22 '24 20:08 jonathanedey

Hey @tinyscratch if you are still having this issue please reach out to https://firebase.google.com/support/troubleshooter/contact/ and file a support request so the relevent teams can take a look. Thanks!

lahirumaramba avatar Aug 30 '24 18:08 lahirumaramba

Hi. Getting this error using the raw protocol on nodeJS (with auth client). How does one get the refresh token using the raw protocol? The docs point out that this is handled automatically. Thanks.

kiwavi avatar Sep 17 '24 05:09 kiwavi