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 user's PasswordHash to be base64 URL decoded before user import #480

Merged
merged 2 commits into from
Feb 15, 2022

Conversation

thomasmburke
Copy link
Contributor

Developers are having trouble migrating users because of the issue described here. This update looks to update the snippet used in https://firebase.google.com/docs/auth/admin/import-users#import_users_with_firebase_scrypt_hashed_passwords to help users migrate users and avoid issues surrounding double base64 encoding.

@thomasmburke
Copy link
Contributor Author

So the update for this doc snippet updating two things:
1.) Decoding the user password hash
- currently we don't so when a dev performs import the password hash is getting double encoding leading to invalid password errors when the correct password is provided for a newly imported user
2.) Updating the decoding functions so the hash.Scrypt key uses standard base64 encoding and user password hashes uses base64URL encoding
- currently the snippet doesn't decode the use password hash, but it should using a base64URL encoding

@lahirumaramba lahirumaramba self-assigned this Feb 15, 2022
Copy link
Member

@lahirumaramba lahirumaramba left a comment

Choose a reason for hiding this comment

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

Thank you @thomasmburke ! LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants