firebase / firebase/firebase-admin-node

Cannot call `getSignedUrl` when using authorized_user default credentials locally

未关闭
#2,413 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
api: storage
主要语言
TypeScript
星标
1.7k
派生
419
平均合并
3 天 10 小时
30 天内合并 PR
16

描述

### [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](http://stackoverflow.com/)
with the firebase tag.
* For general Firebase discussion, use the [firebase-talk](https://groups.google.com/forum/#!forum/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](https://firebase.google.com/support/).

### [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](https://github.com/googleapis/nodejs-storage/issues/360)).

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?

贡献指南

打开贡献指南

调研方向

Start by tracing firebaseAdmin.credential.applicationDefault() and Bucket.file().getSignedUrl(), then compare the credential fields available for authorized_user credentials with the signing requirements. Done means establishing whether this credential type is supported, identifying a documented workaround, or defining the required SDK change.

由索引模型根据 Issue 内容生成。

评估

技术栈
node.js, typescript
领域
authentication, cloud
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。