Skip to content

Instantly share code, notes, and snippets.

View grant-killian's full-sized avatar

Grant Killian grant-killian

View GitHub Profile
@grant-killian
grant-killian / UpdateIdentityServerHashAlgorithm.ps1
Last active January 2, 2019 17:39
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"},
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
Import-Module WebAdministration
$url = "https://kb.sitecore.net/~/media/7A638A36A71D4494981A8655E297AD23.ashx?la=en"
$tempLocation = "C:\tempLocation"
$zippedPatch = "$tempLocation\SitecoreSupportPackage.302938.zip"
$unzippedPatch = "$tempLocation\SitecoreSupportPackage"
$sitecoreRoot = "C:\InetPub\Your\Sitecore\Website"
if (!(Test-Path $tempLocation))