0

Currently, I am trying to import users with already hashed passwords into Firebase by solely using the 'firebase-tools' package. I am able to list my current projects by using the command:

        client.list({
            token:fbToken
        }).then(function(data){
            console.log(data);
        });

but am unable to import any users when trying to use the auth:import command.

        client.auth:import({
            account_file: "driverList.json",
            project:"projectName",
            token: fbToken,
            hash-algo: "BCRYPT"
        }).then(function(data){
            console.log(data);
        });

I believe that this is because the CLI syntax for auth import is not easily translatable to javascript like the other one word commands (list, logout, etc.). I've tried looking at the documentation, but had no luck.

Does anyone have any idea how to go about this issue? Here is a link to the git repo.

AL.
  • 36,815
  • 10
  • 142
  • 281
  • One thing that might help is that dashes should be camelcased and args should be named: `{dataFile: 'driverList.json', project: 'project-id', token: fbToken, hashAlgo: 'BCRYPT'}` – Michael Bleigh Feb 14 '17 at 23:38

1 Answers1

0

I was having trouble with this as well, and it took literally digging around in the library to try and find answers. In the index.js file here you can see alias' for the listed bash commands. So for auth:import you should call client.auth.upload. However I have yet to find any documentation on the arguments you need to use for the node functions. I suspect they are buried in their corresponding alias here, but not even the deploy function there lists the arguments they use for it in the README. If someone finds any documentation on using arguments, I'd love to know as well.