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

fix: Fix impersonated service account parsing exception

Open blue-hope opened this issue 3 years ago • 2 comments

Discussion

  • related to #1861

Testing

  • test for checking impersonated service account added.

API Changes

  • no change on public API

blue-hope avatar Aug 10 '22 16:08 blue-hope

Can I get any feedback on this? Or discussion on #1861 ?

blue-hope avatar Aug 16 '22 09:08 blue-hope

@blue-hope thanks for the PR!

@lahirumaramba I notice you self-assigned the related issue https://github.com/firebase/firebase-admin-node/issues/1703 - would you be able provide any input on how to move this forward? Thanks very much!

nathan-stable-auto avatar Aug 31 '22 00:08 nathan-stable-auto

@lahirumaramba I hope this feature will be dealt with soon. I would be so appreciated if you could give us a feedback or review.

blue-hope avatar Oct 12 '22 09:10 blue-hope

Thank you everyone for your patience! Hey @blue-hope Thank you so much for the contribution! Just adding this note to let you know that I have started the review process. We also plan to migrate the credentials implementation to google-auth-library-nodejs (see https://github.com/firebase/firebase-admin-node/issues/1377) and once that is done firebase-admin will reach feature parity with google-auth-library-nodejs. In the meantime, I think it is reasonable to merge this change.

lahirumaramba avatar Oct 18 '22 15:10 lahirumaramba

Thank you so much for reviewing. (+ Just curious, when will that google-auth-library-nodejs implementation be finished?)

blue-hope avatar Oct 18 '22 16:10 blue-hope

@lahirumaramba just a side-note on the migration to google-auth-library-nodejs: Right now, it's possible to do the following using a local service account:

Run: gcloud auth application-default login

initializeFirebase({project: 'project'});

getFirestore().doc('foo/bar').get();

However, trying to authenticate with Identity Toolkit / Firebase Auth would fail:

initializeFirebase({project: 'project'});

getAuth().getUser('uid'); // -> throws an error

Would the migration to google-auth-library-nodejs library fix this problem?

IchordeDionysos avatar Nov 13 '22 14:11 IchordeDionysos

Thank you so much for reviewing. (+ Just curious, when will that google-auth-library-nodejs implementation be finished?)

I can't promise a timeline for this, but we are starting the initial work this year. It will be a bit complex migration so we plan to perform it in multiple stages. We will use #1377 to track any progress.

lahirumaramba avatar Nov 18 '22 20:11 lahirumaramba

@lahirumaramba just a side-note on the migration to google-auth-library-nodejs: Right now, it's possible to do the following using a local service account:

Run: gcloud auth application-default login

initializeFirebase({project: 'project'});

getFirestore().doc('foo/bar').get();

However, trying to authenticate with Identity Toolkit / Firebase Auth would fail:

initializeFirebase({project: 'project'});

getAuth().getUser('uid'); // -> throws an error

Would the migration to google-auth-library-nodejs library fix this problem?

Hi @IchordeDionysos, This looks a bit strange. gcloud auth application-default login should set GCLOUD_CREDENTIAL_PATH and load ADC. If this is reproducible, please file a new issue with a code sample and any error logs. Thanks!

lahirumaramba avatar Nov 18 '22 20:11 lahirumaramba

@lahirumaramba I'll add missing tests and notice to you before merge, thanks!

blue-hope avatar Nov 22 '22 12:11 blue-hope

@lahirumaramba New test added. I missed checking implicit discovered credential, thanks a lot.

blue-hope avatar Nov 23 '22 04:11 blue-hope

@lahirumaramba When this will be released? 😄

blue-hope avatar Dec 21 '22 03:12 blue-hope

Definitively need this

Klaitos avatar Jan 12 '23 14:01 Klaitos

Thank you @blue-hope for your contribution. This feature is now included in the v11.5.0 release.

Thanks folks for your patience on this! Try out the new feature if you get a chance and let us know what you think. If you encounter any issues, please open a new issue on Github. Thank you!

lahirumaramba avatar Jan 19 '23 17:01 lahirumaramba