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

Updating argon2 password guidance. #848

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -597,8 +597,9 @@ public void importWithArgon2() {
List<ImportUserRecord> users = Collections.singletonList(ImportUserRecord.builder()
.setUid("some-uid")
.setEmail("user@example.com")
.setPasswordHash("password-hash".getBytes())
.setPasswordSalt("salt".getBytes())
.setEmailVerified(true)
.setPasswordSalt(Base64.getDecoder().decode("VERvRWRsRklaVERQckJzUg")) // Provide the password salt only
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is just a snippet, could you please revert this string back to the the descriptive version ("password-hash" or "salt"), since it makes it clearer to the developer where this input comes from, and matches other examples.

.setPasswordHash(Base64.getDecoder().decode("dYpfJgmRyTZefxRiToYFpO+4PyaHPsHIKz5VI/FE06w")) // Provide the password key only
Copy link
Contributor

@ssbushi ssbushi Oct 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @oeribo,

Thank you very much for contributing.

  • Could you provide a little more context on the new guidance that you are suggesting for Argon2 here? It looks like to me that you're trying to match other snippets that use the Base64 decoding libraries in the other examples from https://firebase.google.com/docs/auth/admin/import-users#java_2 (which is perfectly fine! I wanted to make sure that I got this right).

.build());
UserImportOptions options = UserImportOptions.withHash(
Argon2.builder()
Expand Down