Signed URLs vs Signed Cookies vs Tokens: Protecting Video Across Multiple CDNs

Signed URLs, signed cookies or tokens? How each protects video at the CDN edge, where each breaks for HLS, and how to keep access rules consistent across CDNs.

By
Alex Khazanovich
Published
Nov 26, 2026

It's fight night, and ten thousand people have paid to watch. Ten minutes in, one of them pastes the stream link into a group chat. If that link works for strangers, you're now giving the main event away.

‍

So you lock it down. You sign the playlist link, and it plays fine in a browser. Then a paying customer casts it to the TV, and it stops after a few seconds. Later, a second CDN takes over during the spike, and every request it gets fails.

‍

Each method here answers one question: is this viewer allowed to fetch this file? Secure video streaming asks it thousands of times per viewer, on every device and every CDN. Here's how signed URLs vs signed cookies vs tokens compare, and where each one breaks.

‍

Key Takeaways

‍

  • Signed URLs and signed cookies carry proof of access. A token is that proof in general form, and it can ride in a URL, cookie, header or path.
  • Signing the playlist doesn't sign the stream. Every segment request needs the proof too, and HLS players don't pass it on by themselves.
  • Check the token at the edge, then keep it out of the cache key, or each viewer gets a private copy of every segment.
  • Most CDNs sign in different formats, so one token rarely works on all of them.

‍

{{promo}}

‍

Signed URLs and Per-File Video Access

‍

A signed URL is a link that carries its own permission slip. Your backend takes a few facts, usually the file path and an expiry time, and seals them with a secret key. The result, the signature, goes on the end of the link. Anyone can read it, but nobody without the key can forge it or stretch the expiry.

‍

Once you require signatures, the CDN checks each one before serving. That makes a signed URL the simplest form of hotlink protection: the link pasted into the group chat dies when it expires.

‍

The catch shows up with HLS. The player loads your signed playlist, then requests each file it lists, usually by a short relative path like 720p/segment1.ts. A relative path doesn't inherit the playlist's query string. So the signature never reaches the segments, and the first segment request is refused.

‍

A backend signs a playlist link and the CDN serves it, but the segment request carries no signature and is refused.

‍

There are four common ways to get it there:

‍

  • Put the token in the path. Files listed relative to a tokenized folder carry it automatically.
  • Rewrite the playlist for each session, so every listed URL carries its own signature.
  • Use the HLS EXT-X-DEFINE tag with its QUERYPARAM attribute. It turns a query parameter on the playlist URL into a variable the listed URLs can use. It needs HLS version 11, and player support varies.
  • Add it in the player. hls.js and Shaka Player both have hooks that can change each request before it's sent.

‍

Where Signed Cookies Fit for HLS Segments

‍

Signed cookies attack the same problem from the other side. The permission slip goes in a cookie instead of the link. The browser attaches it to every request for that domain on its own, so playlists and segments stay untouched. CloudFront recommends cookies for exactly this case: many files behind one permission.

‍

The catch is that cookies only work when the client actually sends them. That's where real deployments get stuck:

‍

  • Cross-site rules. If your site is example.com and the video comes from a CDN's own domain, Safari treats the cookie as third-party and blocks it.
  • CORS. The CDN must name your site's origin exactly and send Access-Control-Allow-Credentials: true. A wildcard origin won't work.
  • Casting and TVs. A Chromecast receiver makes its own requests, so it needs its own credentials. Apple developers have reported AirPlay dropping authorization headers.
  • Domain scope. This fixes the first problem: serve media from media.example.com and set the cookie for example.com.

‍

That's the fight-night TV that stopped: the phone had the credential, and the TV never got it.

‍

A phone's browser sends the signed cookie with every request and is served, but the cast TV has no cookie and is refused.

‍

Token Authentication at the CDN Edge

‍

Token based authentication is the general form of the same idea. Your backend issues a token, a sealed bundle of claims. Claims are facts it vouches for, such as an expiry, allowed paths, a session ID and an IP address. The CDN edge checks the token on every request.

‍

Expiry is where teams get burned. CloudFront checks expiry when each request starts. A segment that's already downloading finishes, but the next request fails. Put a five-minute token on the two-hour fight stream with no renewal flow, and every viewer is cut off five minutes in.

‍

Then there's CDN caching performance. A CDN stores each file under a cache key, usually its URL. If the token stays in that key, every viewer's copy of a segment looks like a different file. Take fight night: 10,000 viewers, two hours, six-second segments. With the token in the key, that's up to 12 million unique objects. Without it, it's 1,200 objects that everyone shares.

‍

A token kept in the cache key stores a copy per viewer, while a checked and dropped token leaves one shared copy.

‍

So validate the token first, then drop it from the cache key. Each CDN handles that differently:

‍

  • CloudFront's default cache policy leaves query strings out of the cache key. If you cache on them, exclude the token ones.
  • Akamai lets you ignore chosen query parameters.
  • Fastly keys on the full URL by default, so your code strips the token after validating it.
  • Cloudflare can ignore all query strings on any plan, but ignoring selected ones requires Enterprise.

‍

Comparing the Three Methods for Video Protection

‍

Here's how they line up:

‍

Signed URLSigned cookieEdge token
Best forSingle files and downloadsBrowser playback on your own domainStaged access and custom rules
Reaches segmentsOnly with a path token, rewrite, tag or hookYes, if the client sends cookiesDepends on how it travels
Works on TVs and castingUsually, if the URL carries itOften not without extra workUsually, in a path or query
Cache impactNone, if kept out of the cache keyNone for shared mediaNone, if validated and stripped first
Early revocationKey rotation or a denylistKey rotation or a denylistA session ID makes a denylist possible

‍

None of these stops someone recording their screen. That takes DRM, such as FairPlay or Widevine. The stakes are real: in November 2024, police backed by Europol shut down one illegal streaming network that served over 22 million users.

‍

Keeping Access Rules Consistent Across Multiple CDNs

‍

Back to fight night. Traffic spikes, and your steering moves half the viewers to a second CDN. If that CDN can't read your tokens, all of those requests fail. Each CDN speaks its own signing dialect:

‍

CDNSigning format
Amazon CloudFrontRSA or ECDSA keys; SHA-256 since April 2026, SHA-1 by default
AkamaiHMAC, SHA-256 by default
Google Cloud CDNHMAC-SHA1
Bunny.netHMAC-SHA256
Azure Front DoorNo signed URLs; Entra ID header tokens in preview, Premium only

‍

A token CloudFront accepts means nothing to Akamai. The usual workaround is signing once per CDN and keeping keys and expiry rules aligned by hand.

‍

The industry's answer is a shared format, the Common Access Token (CAT), standard CTA-5007. CloudFront added CAT support in November 2025, and Akamai has an EdgeWorkers module. CloudFront's helper checks the signature, but it doesn't check expiry or audience. Akamai's module ignores expiry by default. "Supports CAT" means a shared format, not shared enforcement.

‍

Revocation needs the same care. Say you revoke the account that leaked the link, but only one CDN gets your denylist. The moment steering sends that viewer to the other CDN, they're back in. Your protection is only as strong as your weakest CDN.

‍

IO River handles this at the platform level. Its Signed URLs feature generates one signature that every CDN in your service verifies. You add a key once and enable URL signing for a path pattern, like /streams/*. Then requests without a valid signature are blocked on every CDN.

‍

Steering sends half the viewers to CDN B, which can't read the token, until IO River Signed URLs gives one shared signature.

‍

You still attach the query-string signature to segment requests, through a playlist rewrite or a player hook. But you sign once and get the same answer on every CDN. For custom checks, such as validating a JWT, IO River lets you write edge code once and run it on Cloudflare, CloudFront and Fastly. For more on edge protection, see our guide to CDN security solutions.

‍

{{promo}}

‍

Conclusion

‍

Signed URLs travel almost anywhere. Cookies keep playlists clean, while tokens carry richer rules. Choose by the devices your viewers actually use, and test segment access on each one. Keep the token out of your cache key. With more than one CDN, make sure every CDN enforces the same rules.

‍

FAQs

‍

Can signed URLs be revoked before they expire?

‍

Not individually, by default. A signature stays valid until it expires, unless you remove the key that signed it, which cuts off everyone using that key. To revoke one session, the edge must check a denylist on each request. Akamai's built-in revocation takes about five minutes to start. Custom denylists in edge data stores update in seconds to minutes.

‍

How long should a signed URL stay valid?

‍

Long enough to cover the whole viewing session, unless you renew it. CloudFront checks each request when it starts, so once a link expires, the next segment request fails. Mux advises at least the video's length. A practical pattern is a short entry token exchanged for a session token that lasts the length of the video.

‍

Can signed cookies be shared between users?

‍

Yes. A signed cookie is a bearer credential, so anyone who copies it can use it until it expires. HttpOnly and Secure flags limit theft by scripts, not copying by the owner. Binding to an IP address helps, but it breaks when phones switch networks. Limiting sessions needs a live session service.

‍

Does token authentication affect CDN cache hit ratio?

‍

It does if the token stays in the cache key, because each viewer then gets a private copy of every segment. Validate the token first, then cache on the clean path. CloudFront and Akamai can ignore token parameters, while Fastly needs custom code. On Cloudflare, excluding selected query strings requires an Enterprise plan.

‍

Do signed URLs stop screen recording?

‍

No. Signed URLs decide who can download the video files, not what happens after the video plays. Stopping capture takes DRM. FairPlay, for example, blacks out protected video during system screen recording on Apple devices. Forensic watermarking then helps trace a leak back to a session, so you can shut it down.