Closed
Description
[REQUIRED] Step 2: Describe your environment
- Operating System version: Windows 10 (latest updates)
- Firebase SDK version: 3.18.4 (firebase --version)
- Library version: 5.12.0 (firebase-admin in packages.json)
- Firebase Product: storage (via npm package firebase-admin)
Steps to reproduce:
Trying to create a custom bucket via the firebase-admin
npm module and even though my service account 100% has the storage.buckets.create
permission (I've even created a custom role and explicitly assigned it this along with having the standard Storage Admin permission too).
I get the following error:
firebase-adminsdk-lwphn@XXX.iam.gserviceaccount.com does not have storage.buckets.create access to project 265909605284.
I believe this error is not accurate - or I'm doing something really stupid??
Relevant Code:
const admin = require('firebase-admin');
const serviceAccount = require('./storage-service-account.json');
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
projectId: serviceAccount.project_id,
authDomain: 'XXX.firebaseapp.com',
storageBucket: 'XXX.appspot.com',
});
const bucket = admin.storage().bucket('my.custom.bucket');
bucket.create() // OR bucket.get({ autoCreate: true });