Skip to content
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

Cannot call getSignedUrl when using authorized_user default credentials locally #2413

Open
Derrreks opened this issue Dec 14, 2023 · 2 comments

Comments

@Derrreks
Copy link

[READ] Step 1: Are you in the right place?

  • For issues related to the code in this repository file a Github issue.
  • If the issue pertains to Cloud Firestore, read the instructions in the "Firestore issue"
    template.
  • For general technical questions, post a question on StackOverflow
    with the firebase tag.
  • For general Firebase discussion, use the firebase-talk
    google group.
  • For help troubleshooting your application that does not fall under one
    of the above categories, reach out to the personalized
    Firebase support channel.

[REQUIRED] Step 2: Describe your environment

  • Operating System version: macOS 11.7.9
  • Firebase SDK version: firebase-admin 11.11.0
  • Firebase Product: Cloud Storage
  • Node.js version: 18
  • NPM version: 9.9.0

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

What happened? How can we make the problem occur?
This could be a description, log/console output, etc.

I'm initializing like:

export const admin = firebaseAdmin.initializeApp({
  credential: firebaseAdmin.credential.applicationDefault(),
  ...

but when I do that am unable to call Bucket.file().getSignedUrl() with the error:

Error: Cannot sign data without `client_email`

Looking into my local Firebase credentials, I notice there is no client_email there, but there is when using service accounts. I've found some issues around that seem to say this isn't possible with a personal service account (example).

If that's true, is it not possible at all to use my personal service account to work with files? Or is there a workaround that will enable this to work?

@google-oss-bot
Copy link

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@Derrreks Derrreks changed the title Cannot call getSignedUrl when using default service account locally Cannot call getSignedUrl when using authorized_user default credentials locally Dec 14, 2023
@ottob
Copy link

ottob commented Feb 26, 2024

We have the same issue. It would be great to see a proper solution to this.

As a workaround we made a special cloud function (that is always running in the cloud) that generates signed urls that we call instead of the normal getSignedUrl functions when running in the emulator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants