-
Notifications
You must be signed in to change notification settings - Fork 960
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Service Usage Consumer Role breaks user account access #7209
Comments
Hey @rosera, sorry to hear you encountered this issue, and thanks for the detailed report. Just to verify, are you setting the environment variable I’m trying to replicate this locally, but so far I’m only able to reproduce the issue if |
Hi @aalej , Checking the environment variable Testing
I checked the above using the Qwiklabs environment and my personal account and both populate the |
Thanks for verifying @rosera. I’ll raise this to our engineering team to see what we could do to address this issue. I’ll also mark this as reproducible. |
I think I'm having this same issue in GKE when using a service account for the application and a separate one from a different project for a very specific Firebase API call. In that case I also get the same error message:
Granting the This happened after upgrading Found the actual issue, sorry for the spam. |
Thanks for digging into the real cause of this @ricardograca-scratch. Making a note here to remind us to update to the next major version of firebase-admin as soon as its available. |
I'd like to get some clarity on which release will address this issue. The original comment mentioned the permission |
Hi everyone! Sorry for repeating the response, but I'm adding this comment to make it clearer for those who encountered the same issue. I faced the issue while trying to create a Cloud Function that adds custom claims to Firebase Auth. The logs were consistently showing this error message:
I spent hours searching for documentation on this issue, but there was no clear guidance on how to resolve it, and no mention of needing to add a specific environment variable. After trial and error, I found this issue and I managed to fix the issue by adding the following environment variable to my Cloud Function configuration:
To resolve the issue, you can:
This was the missing piece for me
|
This issue is now fixed in the latest version of |
FYI - firebase-tool v13.25.0 tested and working. NOTE: If using Google CloudShell, ensure the |
Thanks! |
Environment info
firebase-tools:
firebase cli v13.8.0
Debian v12
Platform:
Google CloudShell
firebase cli v13.8.0
andgcloud SDK v475.0.0
Test case
Testing
Tests were conducted using
firebase cli v13.8.0
andgcloud SDK v475.0.0
.service account
was able to access the firebase project as the correct permission appears to be available.user account
is unable to access the firebase project. I have provided the error log below.Steps to reproduce
In testing, I used both a user account (on CloudShell - Debian 12) and a service account (via GCE instance Debian 12).
The test project includes a Firebase project accessed from Google Cloud Shell. The Firebase project features a Firestore database. Logging into the project was successful, however I was unable to access any services e.g.:
Expected behavior
Facing issues when using a user account to access Firebase using the CLI tool. I believe the issue relates to the below PR.
Ref: PR
Both user and service accounts should be able to access the firebase project services when using only the
roles/firebase.admin
permission.Actual behavior
When using CloudShell on Google Cloud, where the user account has been given
roles/firebase.admin
permission. Previously this has been working since the end of 2023 deployment in a lab delivered on the CloudSkillsBoost site.The internal link for this is b/341023115
After the above some recent changes to Firebase cli, the user account with
roles/firebase.admin
is no longer able to access Firebase projects using the cli tool. The response indicates an additional service account permission is required (i.e.roles/serviceusage.serviceUsageConsumer
).I believe the relevant change is here: PR.
Error Log
I have the following information from
firebase-debug-log
:The text was updated successfully, but these errors were encountered: