tencent cloud

Feedback

Authentication Method B

Last updated: 2024-08-14 19:04:36

    Format of Authentication URL

    http://Hostname/timestamp/md5hash/Filename

    Parameter Description

    Field
    Description
    Hostname
    Site acceleration domain name.
    Path
    Resource access path, which must start with / during authentication.
    timestamp
    UTC+8 time in the format of YYYYMMDDHHMM, e.g., 201807301000.
    md5hash
    A string containing 32 characters calculated based on the MD5 algorithm:
    Algorithm: MD5 (key + timestamp + Path).
    Authentication logic: If the request has not expired, the node will compare this string value with the md5hash value carried in the request URL. If the values are the same, the request will pass the authentication, and a response will be made to the request; if the values are different, the authentication will fail, and 403 will be returned.

    Configuration Example

    Assuming authentication method B is used for the requested URL https://www.example.com/foo.jpg, the configuration is as follows:
    

    Getting Authentication Parameters

    Path: /foo.jpg.
    timestamp: The time when the server generates the authentication URL is 15:33:50, July 15, 2024 (UTC+8), the decimal (YYYYMMDDHHmm) value of which is 202407151533.
    Key: DvYmqE81E1F9R791H6lmht.
    md5hash: MD5 (key + timestamp + Path) = MD5 (DvYmqE81E1F9R791H6lmht202407151533/foo.jpg) = d1f0b51c6894231fc12e054fcc7f0b3e.

    Authentication URL Generated by a Client Request

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

    Node Authentication

    When the node server receives a client request via the encrypted URL, it will parse the timestamp parameter in the URL, and compare the sum of it and the configured validity period of ''1 second'' with the current time:
    1. If the current time is after the ''timestamp + validity period'' time, it indicates that the request has expired, and 403 will be returned directly. If the current time is before the ''timestamp + validity period'' time, it indicates that the request has not expired, and the node server will go to step 2.
    2. The node server calculates the md5hash value based on the obtained authentication parameters and compares it with the md5hash value carried in the request URL. If the values are the same, the request will pass the authentication, and a response will be made to the request; if the values are different, the authentication will fail, and 403 will be returned.
    
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support