Authentication Method C
Authentication URL Format
http://Hostname/md5hash/timestamp/Filenamehttps://Hostname/md5hash/timestamp/Filename
Parameter description
Field | Description |
Hostname | Site Acceleration Domain. |
Path | Resource access path, authentication requires prefixing with /. |
timestamp | Unix timestamp in hexadecimal form (the total number of seconds from 00:00:00, January 1, 1970, UTC time to now, regardless of the time zone) |
md5hash | A fixed-length string of 32 characters calculated using the MD5 algorithm: Algorithm: MD5(Key + Path + timestamp). Note: When calculating, the hexadecimal timestamp must filter out the hexadecimal number identification 0x. Authentication Logic: If the request has not expired, the node compares this string value with the md5hash value carried in the request URL. If the values are the same, authentication passes, and the request is responded to; if the values are different, authentication fails, returning 403. |
Configuration Samples
Assuming the request URL
https://www.example.com/foo.jpg uses authentication method C, Since this method prepends the authentication information /{md5hash}/{timestamp} before the actual resource path, the actual URL Path when the request reaches the node is /{md5hash}/{timestamp}/foo.jpg. The rule engine's「URL Path」matching operates on the original request path carrying the authentication prefix, not the actual business path.Therefore, the matching condition must use "Regular Expression Matching" to include the authentication prefix. It cannot be configured based on the actual business path (for example, URL Path equals /foo.jpg), otherwise the request will fail to match the rule.A configuration example is provided below:

Get authentication parameters:
Path:
/foo.jpg.timestamp: The server-generated time for the authentication URL is 2024-07-15 15:43:06 (UTC+8), converted to hexadecimal (Unix timestamp) format is
6694d30a.Key:
DvYmqE81E1F9R791H6lmht.md5hash: MD5(Key + Path + timestamp) = MD5(
DvYmqE81E1F9R791H6lmht/foo.jpg6694d30a) = 6688749e8906a726c12fe1be3aacd016. Authentication URL generated by the client request
https://www.example.com/6688749e8906a726c12fe1be3aacd016/6694d30a/foo.jpg.Node Authentication
When the Node Server receives a request sent by the client via an encrypted URL, it parses the timestamp parameter from the URL, adds the configured effective duration of "1 second", and compares it with the current time:
1. exceed the "timestamp + effective duration" time, the request is not expired, continue to step 2.
2. The Node Server calculates the md5hash value using the obtained authentication parameters and compares it with the md5hash value carried in the request URL. If the values are the same, authentication passes and the request is responded to; if the values are different, authentication fails, returning 403.
3. After node authentication passes, the system automatically strips the
/{md5hash}/{timestamp} prefix and uses the actual business path /foo.jpg to fetch content from the origin.