Trying To Make Hmac-sha256 Work With Powershell For Canvas Api
I was appointed the task of making a process in which a PowerShell script needs to make a call to Canvas servers in order to get data out of it for other uses that are outside the
Solution 1:
In PowerShell, the default escape sequence uses backticks `
rather than backslash \
.
In order for the parser to recognize the escape sequence as not just a backtick character literal and the letter n
, use an expandable string ("
instead of '
):
$message = "GET`n`n`n`nmycrazymessage`n`nFri, 18 Nov 2016 15:29:52 GMT`nmycrazysecret"
Other than that, your HMAC signature procedure is correct (it correctly outputs Oexq8/ulAGxSIQXGDVqoXyqk5x+n9cMrc3avcTW9aZk=
after changing the $message
value)
Post a Comment for "Trying To Make Hmac-sha256 Work With Powershell For Canvas Api"