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

user file, password field value, how to generate? #928

Closed
ericxin1982 opened this issue Feb 8, 2022 · 2 comments
Closed

user file, password field value, how to generate? #928

ericxin1982 opened this issue Feb 8, 2022 · 2 comments

Comments

@ericxin1982
Copy link

image

Hi,

I read this chapter, and as it stated, the users.json should be existed and data inside should be ready for authenticated, and how to generated each users' password, there is no mention in this chapter.

Thanks
Eric Xin

@Badgerati
Copy link
Owner

Hi @ericxin1982,

It comes down to personal preference on what tool you'd like to use to generate the SHA256s, but if you're opting for PowerShell:

$password = 'Passw0rd'
$crypto = [System.Security.Cryptography.SHA256]::Create()
[System.Convert]::ToBase64String($crypto.ComputeHash([System.Text.Encoding]::UTF8.GetBytes($password)))

or for HMAC SHA256:

$password = 'Passw0rd'
$secret = [System.Text.Encoding]::UTF8.GetBytes('secret_salt')
$crypto = [System.Security.Cryptography.HMACSHA256]::new($secret)
[System.Convert]::ToBase64String($crypto.ComputeHash([System.Text.Encoding]::UTF8.GetBytes($password)))

@ericxin1982
Copy link
Author

Thanks!

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

2 participants