Skip to content

Instantly share code, notes, and snippets.

@Selleray
Last active January 28, 2020 10:36
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 Selleray/43f6822ba08d7fe8086c187cdc3f2e08 to your computer and use it in GitHub Desktop.
Save Selleray/43f6822ba08d7fe8086c187cdc3f2e08 to your computer and use it in GitHub Desktop.
Create Hmac Data
<ee:transform doc:name="HMAC Auth Header Conversion" doc:id="790a2701-1989-4281-a6ca-c324e55d70ed">
<ee:message />
<ee:variables>
<ee:set-variable variableName="HMACToken"><![CDATA[%dw 2.0
import dw::Crypto
import * from dw::core::URL
import * from dw::core::Binaries
output application/json
---
encodeURIComponent(toBase64(Crypto::HMACBinary( vars.authentication.apiSecret as Binary, vars.hmacData as Binary)))]]></ee:set-variable>
</ee:variables>
</ee:transform>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment