Configure secure token
Do the first three steps in Gcore Customer Portal on the Secure token tab.

http://cdn.example.com/photo.jpeg
is the path to the file,DMF1ucDxtHCxwYQ
is the output of the “MD5(String)” hash function, where String is the parameter obtained by merging elements:<link expiry time><file path><allowlisted IP address><key from Step 2>
,2147483647
is the time in the UNIX timestamp format until which the link is considered valid.
Using “secure token” in conjunction with “query string forwarding” feature
When “query string forwarding” feature is enabled, then the file name needs to be omitted from the script used for link generation. In an example where we have the following URL: “example.com/images/moon.jpg” path should be configured as follows: For PHP:Scripts for link generation
Generate links with a secure token in PHP
Below is the script for creating temporary links with the IP-based access restriction. The files will be accessible only from an allowlisted IP address and only until the link expires.- $secret is the secret key,
- $path is the path to the file,
- $ip is the IP address that is allowed to access the content,
- $expires is the link expiry time (in seconds),
- $url is the address of the file.
Generate links with a secure token in Python
The script for creating temporary links with the IP-based access restriction. The files will be accessible only from an allowlisted IP address and only until the link expires.- secret is the secret key,
- path is the path to the file,
- ip is the IP address that is allowed to access the content,
- expires is the link expiry time (in seconds),
- secured_url is the link to the file.
Generate a secure token in OpenSSL
The script for creating a secure token that limits the link lifespan and allows access only to an allowlisted IP:- 2147483647/images/1.jpg is the path to the file,
- 1.2.3.4 is the IP address that is allowed to access the content,
- secret_key is a secret key you specified at Step 2 of the Configure Secure Token instruction.

- http://cdn.example.com/photo.jpeg is the path to the file,
- DMF1ucDxtHCxwYQ is a secure token,
- 2147483647 is the time in the UNIX timestamp format until which the link is considered valid.