All Products
Search
Document Center

:Alibaba Cloud Content Delivery Network authentication exception returns a 403 error for accessing Alibaba Cloud Content Delivery Network acceleration resources

Last Updated:Nov 04, 2021

Description

To protect the resources of the site from being embezzled by illegal site downloads, URL authentication is used to protect the resources of the origin site. After the URL authentication function of the Alibaba Cloud CDN is enabled, access to CDN accelerated resources returns 403 errors. Through the developer tool of the browser, the detailed error information in the Response Header is viewed as follows:

  • No authentication parameters are carried: X-Tengine-Error:denied by req auth: no url arg auth_key
  • Authentication Expiration: X-Tengine-Error: denied by req auth: expired timestamp
  • Authentication calculation error: X-Tengine-Error: denied by req auth: invalid md5hash

Possible cause

After the URL authentication feature is enabled in the Alibaba Cloud CDN, the causes of the error are as follows:

  • No authentication parameters are carried: Authentication is enabled for the Alibaba Cloud Content Delivery Network, but the actual access URL does not carry the authentication parameters.
  • Authentication Expiration: Alibaba Cloud Content Delivery Network authentication is enabled and the URL carries authentication parameters, but the authentication parameters expire.
  • Authentication calculation error: The MD5 value of the authentication parameter is not calculated correctly.

Solution

The solution to the Alibaba Cloud Content Delivery Network URL authentication error is as follows:

  1. Open Chrome Browser and press the F12 key to open the developer tools for your browser.
  2. Switch to the Network label. In the Response Header under the etwork label in the N, check which type of error message it is. According to the error message, do the following:
    • No authentication parameters are carried:
    • The authentication expires
      . If the authentication expires, regenerate the authentication URL.
    • Authentication calculation error
      If the MD5 calculation of authentication is incorrect, we recommend that you use the address generator in the Alibaba Cloud Content Delivery Network console to generate a URL to compare your own authentication code, or see the authentication sample code.

References

Applicable scope

  • CDN