Lumen help
The signature mechanism used by Media portal APIs is HMAC (hash-based message authentication code) and the SHA-1 cryptographic hash function.
The process works as follows:
Selected information from your request, including certain HTTP request header fields, is combined into a string.
A digest of that string is produced using the secret associated with your API key; this is the signature.
The signature and the API key ID are placed in the HTTP authorization header, and the request is sent.
Upon receiving the request, Media portal inspects the authorization header and extracts the API key ID.
Media portal looks up the secret associated with that key. (The secret is known only by the key owner and Lumen.)
Media portal gathers the other inputs to the digest and builds its own signature. If the two signatures match, the request is authenticated.
The authorization HTTP request header field expected from clients is: MPA [API Key ID]:[signature]
MPA (Media portal authentication) is the authentication scheme and signature is a value that is properly constructed as described below.
If an accept header is set in the request, the only valid value is text/XML. Any other value will receive a 406 response.
This signature is constructed in the form of a RFC2104 HMAC‑SHA1 digest. Create a string as follows: [Date ] + “\n” + [RelativePath] + “\n” + [Content‑Type] + "\n" + [HTTP‑Verb] + “\n” + [Content‑MD5]
[Date] ‑ value of the Date request header field formatted as, for example, Wed, 29 Apr 2015 +GMT using Java SimpleDateFormat, use: "EEE, dd MMM yyyy HH:mm:ss +GMT" Java SimpleDateFormat using Locale.US), using Locale.US for the current UTC time.
“\n” ‑ a line feed
[URI or RelativePath] ‑ path of the request including request scope if applicable (access group, service, network IDs). The RelativePath should include the first forward slash (/) but should not include query string parameters. Examples:
/key/v1.0
/usage/v1.0/1234/BBB1234/my.property.com
[Content‑Type] ‑ value of the Content‑Type request header field. For example:
text/xml
application/json
[HTTP‑Verb] ‑ HTTP method used for the request (e.g. “GET”, “PUT”, “POST”, “DELETE”).
[Content‑MD5] (optional) ‑ value of the Content‑MD5 request header field, an MD5 digest of the request body. See RFC 2616 Section 14.15. If this request header is set, then it must be included in the signature string.
Encode this string as UTF8, construct an HMAC‑SHA1 digest (using the secret), then encode the result in Base64. The output of these steps is the signature.
Unauthenticated requests are rejected and an HTTP status is sent. Unauthenticated requests include:
If a request fails authorization, Media portal sends a response code to the requester and logs the request (IP address, requested URI, key ID, date and time).
If you just want get started faster, try using Postman and skip the need for building a signature. simply use this pre-request script for your collection and attach it at the collection level.
Learn more about
Media portal
Explore Media portal
Top 10 articles