Skip to content

Instantly share code, notes, and snippets.

@grant-killian
Last active January 2, 2019 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grant-killian/1c8a2d7e6889e8d90decdf2fbfe540d8 to your computer and use it in GitHub Desktop.
Save grant-killian/1c8a2d7e6889e8d90decdf2fbfe540d8 to your computer and use it in GitHub Desktop.
Update Sitecore's Identity Server to use a more robust hash algorithm for .Net membership. See https://grantkillian.wordpress.com/2019/01/02/sitecore-commerce-security-hardening-note/ for more context.
$siteNamePrompt = Read-Host "enter Identity Server website name"
$site = get-website -name $siteNamePrompt
$appSettingsPath = "{0}\wwwroot\appsettings.json" -f $site.physicalPath
<# replace:
"PasswordHashAlgorithm":"SHA1"},
with:
"PasswordHashAlgorithm":"SHA512"},
#>
(Get-Content $appSettingsPath).replace("""PasswordHashAlgorithm"":""SHA1""},", """PasswordHashAlgorithm"":""SHA512""},") | Set-Content $appSettingsPath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment