SHA1 replaced with SHA256 for the Storefront SSO feature
Breaking changes! Сhanges listed below may break some apps' logic.
What's new
The encryption mechanism for SSO was updated from SHA1 to SHA256 for security enhancement.
SSO (Single-Sign-On) for websitesChanges in API
Payload signing now uses sha256. Code example on PHP:
<?php
$client_secret = "A1Lu7ANIhKD6A1Lu7ANIhKD6ADsaSdsa"; // example value
$message = base64_encode("{appClientId: 'my-cool-app', userId:'234', profile: { email:'[email protected]', billingPerson: { name: 'John Doe' } }}"); // example values
$timestamp = time();
$hmac = hash_hmac('sha256', "$message $timestamp", $client_secret);
echo "<script> var ecwid_sso_profile = '$message $hmac $timestamp'; </script>";
?>
Why the changes are breaking
The SHA1 encryption is now discontinued. If the encryption mechanism isn't updated in the code, the SSO will stop working.
How to update the app
Check if your app uses SSO on the website.
Check the code to find the
hash_hmac()
encryption.Update the
'sha1'
with'sha256'
inside thehash_hmac()
method.
Last updated
Was this helpful?