tencent cloud

Authentication Method B
Last updated: 2025-06-10 11:39:36
Authentication Method B
Last updated: 2025-06-10 11:39:36

Authentication URL format

http://Hostname/timestamp/md5hash/Filename
https://Hostname/timestamp/md5hash/Filename

Parameter description

Field
Description
Hostname
Site Acceleration Domain.
Path
Resource access path, authentication requires prefixing with /.
timestamp
UTC+8 Time, format: YYYYMMDDHHMM, e.g., 201807301000.
md5hash
A fixed length string of 32 bits calculated using the MD5 algorithm:
Algorithm: MD5(Key + timestamp + Path).
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

Assume the request https://www.example.com/foo.jpg uses Authentication Method B, configure as follows:


Get authentication parameters:

Path:/foo.jpg.
timestamp: The server-side generated authentication URL time is July 15, 2024, 15:33:50 (UTC+8), expressed in decimal (YYYYMMDDHHmm) format as 202407151533.
Key: DvYmqE81E1F9R791H6lmht.
md5hash: MD5(Key + timestamp + Path) = MD5(DvYmqE81E1F9R791H6lmht202407151533/foo.jpg) = d1f0b51c6894231fc12e054fcc7f0b3e.

Authentication URL generated by the client request

https://www.example.com/202407151533/d1f0b51c6894231fc12e054fcc7f0b3e/foo.jpg.

Node Authentication

When the Node Server receives a request from the client via the encrypted URL, it extracts the timestamp parameter from the URL, adds the configured Effective duration of "1 second", and compares it to 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.


Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback