Skip to content

Commit 474ae14

Browse files
authored
Make ADC + human account work with firebase-admin
1 parent a37eb6c commit 474ae14

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/utils/api-request.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,11 @@ export class AuthorizedHttpClient extends HttpClient {
818818
const authHeader = 'Authorization';
819819
requestCopy.headers[authHeader] = `Bearer ${token}`;
820820

821+
// Fix issue where firebase-admin does not specify quota project that is necessary for use when utilizing human account with ADC
822+
if (!requestCopy.headers['x-goog-user-project'] && this.app.options.projectId) {
823+
requestCopy.headers['x-goog-user-project'] = this.app.options.projectId
824+
}
825+
821826
if (!requestCopy.httpAgent && this.app.options.httpAgent) {
822827
requestCopy.httpAgent = this.app.options.httpAgent;
823828
}

0 commit comments

Comments
 (0)