Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
ohanquels
Contributor
Contributor

SHA256 Hash in a connection

I need to connect to a REST API that uses SHA256 in its authentication. The pattern is this:

  • generate a hash

  • import secret key

  • generate a SHA256 hash of the secter key and the salt

  • Base-64 encode the hash

  • url-encode the Base-64 encoded hash

  • transmit the result in a header

I know how to do some of this. I can do it all in PHP, but that's not super useful right now. What i want ot know is:

  1. How can I generate a SHA256 hash?

    1. in php, it would be: $salted_hash = hash_hmac('sha256', $salt, $secretKey, true);

  2. How do I urlencode a string?

    1. in php it's simply $string = urlencode('string');

If it helps (or it there is an extension or shortcut to use) this is to connect to a Kayako Classic REST API.

Labels (1)
0 Replies