@joncipriano, @kimenye, or @stoney024 (or anyone) - would you mind posting sample Ruby code for this? I can’t seem to get my code right. It’s responding 200 and definitely less than a second but my url still fails.
This is what I’m trying:
digest = OpenSSL::Digest::SHA256.new
hmac = OpenSSL::HMAC.hexdigest(digest,
<CONSUMER_SECRET>,
params[:crc_token])
crc_response = "sha256=" + Base64.encode64(hmac)
Then the JSON response as follows:
format.json { render status: :ok, json: { response_token: crc_response } }
For example, if my consumer secret was “MY SECRET” and the CRC token was “some_crc_token”, then this code yields:
{"response_token":"sha256=ZjU0MzBjYzUyZTcwYjIzYmZhY2I0YTljM2ZmMGZmZjRhMWE2Njg4YTI4NzQ3\nY2IzMDA4YjA4NDAyNWE2OTk4NA==\n"}
But when using the actual consumer secret this fails with Webhook URL does not meet the requirements.
Could you (or anyone) post some working sample Ruby code and/or some examples of CRC token, fake consumer secrets, and expected response token so I can verify if the algorithm is or is not correct? Sample Ruby code appreciated.
Thanks!