Request Signature
Overview
Requests sent to the server have to be digitally signed for purposes of authentication. The signature uses the Date header and signing algorithm used in License API Authorization.
Signature Structure
The signature in the Authorization header is a Base64-encoded HMAC-hashed value of the signing string, which is composed of:
Date header
The value of the Date header being sent in the request (see License API Authorization for more details). This is a date string in RFC7231 format
This signing string is then hashed with the customer's key (shared key) using the algorithm provided in the Authorization header (e.g. HMAC-SHA256). The resulting hash is then encoded in Base64.
Make sure the encoded string has no extra whitespace on any line, otherwise the base64 encoded value will be incorrect.
Example of Signature Generation
The following is an example of how to generate a signature. First, let's assume the following values:
Your company's shared key is
kw4qSnpSwXzgiv5yxYpZZmFEd9QAeiKTQ6OuyMjaThe Date header you set in the request is
Tue, 07 Jun 2011 20:51:35 GMTWe'll use the default hashing algorithm, HMAC-SHA256
Now we can generate the signature:
Create the signing string:
licenseSpring
date: Tue, 07 Jun 2011 20:51:35 GMTHash the signing string using HMAC-SHA256
Encode the hashed value with Base64: UDysfR6MndUZReo07Y9r+vErn8vSxrnQ5ulit18iJ/Q=
The resulting string is then inserted into the Authorization header as the "signature" parameter:
Sample Code
Generating a signature
Generating full HTTP request headers with SDK Demo keys
Full sample code for checking a license key with SDK Demo keys
Last updated
Was this helpful?