Request Signature
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.
The signature in the Authorization header is a Base64-encoded HMAC-hashed value of the signing string, which is composed of:
- A constant string: licenseSpring
- A newline character \n
- 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.
The following is an example of how to generate a signature. First, let's assume the following values:
- Your company's shared key is kw4qSnpSwXzgiv5yxYpZZmFEd9QAeiKTQ6OuyMja
- The Date header you set in the request is Tue, 07 Jun 2011 20:51:35 GMT
- We'll use the default hashing algorithm, HMAC-SHA256
Now we can generate the signature:
1. Create the signing string:
2. Hash the signing string using HMAC-SHA256
3. Encode the hashed value with Base64: UDysfR6MndUZReo07Y9r+vErn8vSxrnQ5ulit18iJ/Q=
The resulting string is then inserted into the Authorization header as the "signature" parameter:
Generating a signature
Generating full HTTP request headers with SDK Demo keys
Full sample code for checking a license key with SDK Demo keys