Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: Add option for hash input order when importing users #313

Open
jwngr opened this issue Jul 22, 2018 · 0 comments
Open

FR: Add option for hash input order when importing users #313

jwngr opened this issue Jul 22, 2018 · 0 comments

Comments

@jwngr
Copy link

jwngr commented Jul 22, 2018

Feature Request Description

Add a new hash.inputOrder option for the importUsers() auth method, inspired by the --hash-input-order parameter of the Firebase CLI.

It will accept a string value of "SALT_FIRST" or "PASSWORD_FIRST" and it will only apply to the SHA512, SHA256, SHA1, MD5, HMAC_SHA512, HMAC_SHA256, HMAC_SHA1, and HMAC_MD5 algorithms.

Usage Example

const importOptions = {
  hash: {
    algorithm: 'SHA256',
    rounds: 80,
    inputOrder: 'PASSWORD_FIRST',  // or 'SALT_FIRST'
  }
};

return admin.auth().importUsers(users, importOptions)
  .then((results) => {
    console.log('Users successfully imported!', results);
  })
  .catch((error) => {
    console.log('Failed to import users:', error);
  });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants