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:
- Open Chrome Browser and press the F12 key to open the developer tools for your browser.
- 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:
- If you do not need the Alibaba Cloud Content Delivery Network authentication feature, log on to the Alibaba Cloud Content Delivery Network console and disable authentication.
- For more information about how to use the Alibaba Cloud Content Delivery Network authentication feature, see URL authentication.
- 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.
- No authentication parameters are carried:
References
- If you need to forward user requests to the authentication server in the specified method, see Configure remote authentication.
- If a 403 status code occurs when accessing Alibaba Cloud Content Delivery Network acceleration resources, see Alibaba Cloud Content Delivery Network access 403 status code.
Applicable scope
-
CDN