Last active
July 17, 2017 20:02
-
-
Save TimHeckel/ead3a62da4b75f5383f6b9e90efed9b7 to your computer and use it in GitHub Desktop.
Revisions
-
TimHeckel revised this gist
Jul 17, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,5 +5,5 @@ const _valToHash = _sessionToken + ":" + _timestamp; const _hash = CryptoJS.HmacSHA256(_valToHash, _secretKey).toString(CryptoJS.enc.Base64); const _authToken = CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(_sessionToken + ":" + _hash)); return "SIF_HMACSHA256 " + _authToken; -
TimHeckel revised this gist
Jul 17, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,6 @@ const _secretKey = "YOUR_SECRET_KEY_HERE"; const _valToHash = _sessionToken + ":" + _timestamp; const _hash = CryptoJS.HmacSHA256(_valToHash, _secretKey).toString(CryptoJS.enc.Base64); const _authToken = CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(_sessionKey + ":" + _hash)); return "SIF_HMACSHA256 " + _authToken; -
TimHeckel created this gist
Jul 17, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ const CryptoJS = require("CryptoJS"); const _timestamp = new Date().toISOString(); const _sessionToken = "YOUR_SESSION_TOKEN_HERE"; const _secretKey = "YOUR_SECRET_KEY_HERE"; const _valToHash = _sessionToken + ":" + _timestamp; const _hash = CryptoJS.HmacSHA256(_valToHash, _env.secretKey).toString(CryptoJS.enc.Base64); const _authToken = CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(_sessionKey + ":" + _hash)); return "SIF_HMACSHA256 " + _authToken;