Skip to content

Commit 89bf222

Browse files
authored
STREAM-2964 Note gotchas on signedURL docs (cloudflare#914)
1 parent 9101b7e commit 89bf222

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

products/stream/src/content/viewing-videos/securing-your-stream.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,17 @@ Upon creation you will get a RSA private key in PEM and JWK formats. Keys are cr
3131
"result": {
3232
"id": "$KEYID",
3333
"pem": "$PRIVATE_KEY_IN_PEM_FORMAT",
34-
"jwk": "{PRIVATE-KEY-IN-JWK-FORMAT}",
35-
"created": "{TIMESTAMP}"
34+
"jwk": "$PRIVATE-KEY-IN-JWK-FORMAT",
35+
"created": "$TIMESTAMP"
3636
},
3737
"success": true,
3838
"errors": [],
3939
"messages": []
4040
}
4141
```
4242

43+
The `pem` and `jwk` fields are base64-encoded, you must decode them before using them.
44+
4345
### Making a video require signed URLs
4446

4547
Since video ids are effectively public within signed URLs, you will need to turn on `requireSignedURLs` on for your videos. This option will prevent any public links, such as `watch.cloudflarestream.com/$VIDEOID`, from working.
@@ -67,6 +69,8 @@ Restricting viewing can be done by updating the video's metadata.
6769

6870
After creating a key, you can use it to sign unique signed tokens. These tokens can be used in place of video ids in the stream embed code.
6971

72+
For security reasons, the key signing a token to view a video **must** be associated with the same account the video was uploaded to. For example, if you have a key owned by account A attempting to sign a token for a video owned by account B, that token will not be accepted.
73+
7074
You can sign to assert these optional constraints on the token:
7175

7276
- `exp` - expiration; a unix epoch timestamp **after** which the token will not be accepted.

0 commit comments

Comments
 (0)