Protect CDN content with time-limited signed URLs. Includes signing examples, curl tests, player integration, and operational guidance.
Token authentication protects content with time-limited signed URLs. Each URL carries an MD5-based token plus an expiry timestamp; the CDN edge validates both before serving the file. Links expire on schedule and cannot be tampered with — the secret never leaves your server.Use it for HLS / DASH streams, private downloads, embedded video players, and any media you want gated behind your application’s auth.
Open CDN → Distributions → select your distribution.
Go to Access Rules → Add Access Rules (or open an existing rule).
Set the Match Pattern to the path you want to protect (for example /videos/*).
Toggle Token Authentication on.
Click Generate Token to mint a Secret Token, then Copy Token.
Click Create Access Rules to save.
Token authentication is configured per access rule, not globally. Each rule has its own secret, so you can scope tokens to a path prefix and rotate them independently.
Treat the secret like a database password. Store it in your secret manager (AWS Secrets Manager, GCP Secret Manager, Vault, Doppler, etc.), inject it via environment variable, and never commit it to a repo or expose it in client-side code.
The signed URL is a normal HTTPS URL — drop it into any player. For HLS streams, sign the manifest only; segments inherit the rule as long as the Match Pattern covers them.
expires is compared against the edge’s wall clock. Servers signing URLs should run NTP. If your sign host drifts ahead, the edge sees a token that is “already expired”; if it drifts behind, tokens live longer than expected. A skew of ±60 seconds is usually invisible — anything more is a config issue.
The console only stores one active secret per access rule. Rotation is a hard cutover, so do it at low traffic and keep a short overlap by issuing short-TTL tokens leading up to the swap.
T-1h Drop new sign-time TTL to 5 min so old tokens age out fastT-0 Click Regenerate, copy new secretT-0+s Push new secret to your secret manager / app configT-0+m Restart / reload signing servicesT+5m Old tokens fully expired — back to normal TTL
Use one access rule per environment with its own secret and a path prefix that namespaces traffic — for example /prod/* and /staging/*. That way a leaked staging secret cannot sign production URLs.