6

I am trying to export Firebase user accounts using the Firebase CLI by calling this command: firebase auth:export save_file.json --format=json --project=MyProjectName

This returns the following error message:

Error: Authorization failed. This account is missing the following required permissions on project MyProject:

  firebase.projects.get
  firebaseauth.users.get

My account has Owner level permissions which has "Full access to all resources" according to the GCloud IAM settings page.

How could an Owner account be missing the required permissions? And how do I get past this error to perform the export?

I have confirmed that I am logged into the correct account in CLI. When I execute firebase login it returns Already logged in as ****@gmail.com which is the same account I have Owner level permissions for (and which is the account that created the project.)

ASDFQWERTY
  • 399
  • 4
  • 8
  • Did you figure this out? I'm getting authorization failed during 'firebase deploy' even though I'm an owner – btraas Feb 12 '19 at 08:12

2 Answers2

9

The command needs the project ID instead of the project name.

The error makes it sound like a permissions issue (because technically it is--just not for the project I was intending to access), but the underlying cause is that the project argument needs to be the ID instead of the name.

So the command should have included --project=myprojectid-1234 instead of --project=MyProjectName

ASDFQWERTY
  • 399
  • 4
  • 8
0

Have you tried to select project before you do the export call?

$ firebase use MyProject
$ firebase auth:export users.json --format=json

Exporting accounts to users.json
✔  Exported 1000 account(s) successfully.
✔  Exported 1000 account(s) successfully.
✔  Exported 1000 account(s) successfully.
Remi Sture
  • 12,000
  • 5
  • 22
  • 35