At startup, the player should make a call out to a path in order to authenticate and receive a token to allow playback of the video being embedded.
Initially this endpoint will just return a static value, as the aim is simply to make sure the embed code cached in the wild has support for it before even considering enabling tokens in production.
To receive the token, the player should place a request to
https://videos.bentasker.co.uk/token_endpoint and include the following params in the query string
-
vidpath Path of the video to be played
-
ref The referring page
The token server will respond with a JSON encapsulated object containing the following attributes
-
status (boolean) - is auth granted?
-
token (string) - the token string
-
exp (unsigned int) - Expiry epoch for the token,
0 if no expiry
The embed code then needs to append
token and
exp to the manifest path the player will use as query string arguments
t and
e
Activity
2019-04-15 12:40:45
View Commit | View Changes
2019-04-15 12:45:48
-
-
-
-
The changes strip the token from the URL before it's submitted to Piwik so that users with different tokens (which will eventually be all of them) do not appear as different playback URLs in analytics.
The query string to
2019-04-15 12:48:45
View Commit | View Changes
2019-04-15 12:49:47
2019-04-15 12:58:49
The token there is just a string generated with
2019-04-15 13:03:46
Seems logical that a separate issue should be raised for implementing the token generation (with yet another for the edge handling of tokens). Both of those will likely come much later though.
2019-04-15 13:03:46
2019-04-15 13:03:46
2019-04-15 13:03:50