Signed URLs

Signed URLs expire after a time you choose and cannot be shared beyond that.

import hmac, hashlib, time
expires = int(time.time()) + 3600
path = "/videos/launch.mp4"
sig = hmac.new(SECRET, f"{path}{expires}".encode(), hashlib.sha256).hexdigest()
url = f"https://media.example.com{path}?expires={expires}&sig={sig}"

Requests with a missing, wrong or expired signature receive 403 Forbidden.

Was this page helpful? Contact support if something is unclear.