key_pair_id

The `key_pair_id` directive specifies the key used to generate secure tokens for Akamai CDN authentication.

Syntaxkey_pair_id hex_string;
Defaultnone
Context
Arguments1

Description

The key_pair_id directive is an essential part of the secure token functionality for NGINX when integrated with Akamai CDN. By defining the key for generating tokens, this directive helps ensure that only authorized requests can access protected content. The directive takes one argument, which is a hexadecimal string representing the key used in the HMAC (Hash-based Message Authentication Code) algorithm, specifically tailored for security tokens.

When configured, the secure token module utilizes this key to create a HMAC for a token intended to be used with Akamai requests. This token authenticates the request and can have various properties like ACLs (access control lists), timestamps, and potentially an IP address. The underlying implementation performs the necessary calculations to ensure that the generated token includes the required parameters securely hashed together with the key defined by this directive.

The usage of the key_pair_id directive is relatively straightforward but foundational; if misconfigured, it may lead to unauthorized access to resources or complete failure in accessing those secured resources. Thus, having a proper understanding of the intended use and securing the key from unauthorized access is paramount in deployments that rely on Digital Rights Management (DRM) or secured media delivery via CDNs such as Akamai.

Config Example

secure_token_akamai {
    key_pair_id 0123456789abcdef;
    acl some_acl;
    param_name secure_token;
    start 0;
    end 3600;
}

Ensure that the specified key is correctly formatted as a hexadecimal string.

Avoid hardcoding sensitive keys directly into configuration files; consider using environment variables instead.

Make sure to manage key rotation and updates appropriately to maintain secure access.

← Back to all directives