The URL authentication feature protects resources on origin servers from unauthorized access and downloads. Dynamic Route for CDN (DCDN) provides you with three authentication types. This topic describes how authentication type B works and provides an example.
How it works
|DomainName||The domain name of the DCDN node.|
|timestamp||The time when the URL expires. The time is included in the URL and is used to calculate
For example, if you set the access time to 2020-08-15 15:00:00, the request URL will expire at 2020-08-15 15:30:00.
|md5hash||The string calculated by using the MD5 algorithm. It must be 32 characters in length, and can contain digits and lowercase letters.|
|FileName||The actual URL that points to the requested resource on the origin server. The FileName
field must start with a forward slash (
- Retrieve the following object from the origin server.
- Set the key to aliyuncdnexp123.
- Set the time when origin server is accessed to 201508150800.
- The DCDN server creates a signature string to calculate
- The DCDN server calculates the
md5hashvalue based on the signature string
md5hash = md5sum("aliyuncdnexp1234201508150800/4/44/44c0909bcfc20a01afaf256ca99a8b8b.mp3") = 9044548ef1527deadafa49a890a377f0
- Encrypt the request URL.
md5hash value calculated by the DCDN server is the same as the
md5hash contained in the request ( both are 9044548ef1527deadafa49a890a377f0), the request passes authentication. Otherwise, the authentication fails.