-
Notifications
You must be signed in to change notification settings - Fork 439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redirekt args with secure link not working #87
Comments
I don't think passing the query arguments to the manifest URLs will solve your problem, since afaik it is not possible to sign part of the URL with nginx's secure link module out of the box (it is probably possible with a custom module that adds a uri_path variable to nginx, or something like that). In other words, the token passed on the manifest request will not work for the video segments. As I understand, what you're trying to do is have secure video URLs, I can suggest a different solution using 2 other Kaltura modules:
Let me if you need more info on how to configure that |
great! You were right about the chunks, which i forgot as i wrote the issue-ticket. I have not seem that akamai token and cloud front module exits, thanks a lot for showing this to me. A little bit of help how i can generate a validate link would be very helpful. I will try to understand it from the code, but when you can show me a command or shell script how to generate the secure token, that would be helpful. Here is maybe an interesting information why i want to have an alternate secure link and not use only one CDN provider: I want to use akamai server and cloud front, but i also want to balance them with other provider/servers. The balancer handles automatically the first 1-100 connection from our local server (cheaper then CDN streaming) and when the number of users grow up, i switch and turn on the CDN balancer. Maybe you ask why i don't use one CDN? The reality is that CDN providers uses different caching nodes where these nodes were installed on different peerings locations. The GEO locations from these nodes were sometimes not the best peerings to the location to our clients peerings. Cause i do not get a QOS (quality of server) feedback from the caching nodes when a client from us gets in a buffer under situation, i add a own QOS event manager in our players which reports the IP from the caching node to our CDN balancer. The more events were are receiving and collecting from our clients, the more is the transparency of the whole network from the used CDN. I was very surprised to see how overloaded some peerings from big CDN provider were on different times and from the network from the client provider to the caching-node. This seems to be normal, cause internet always works in a best afford modell. For this reasons i have to use an global secure link function to protect our videos thru our own custom build multiple CDN´s. That cloudfront and akamai token exits, helped me a lot. |
Here is some PHP code that generates these tokens in the Kaltura API server: There's also C code that does the same in nginx-secure-token-module but it's easier to read in PHP, hope it helps. Btw, didn't understand if that is what you already planned to do, but note that you have use tokens that correspond to each CDN configuration in order to enable the CDN to cache the content. For example, if you use nginx's secure link token with Akamai, the CDN nodes will not be able to validate the token and all the requests will reach your servers. This means you will need to configure a separate location in nginx.conf for each combination of (protocol, CDN). Non-tokenized configurations can be shared between different CDNs. |
hi erankor, i use the akamai token validator and was, thanks to your help, able to install a secure token module and replace the original secure link from nginx. i study some other stuff and i was impressed how much work you did for the nginx server which is now my favorite one. if you ever need a place to sleep in germany or having a beer, let me know :) may the source with you... |
sorry for coming back to this again, but i still have a problem to get thru to the single manifest and chunks using the akamai token validator plugin. Please take look what i did:
local hls playback
The master.m3u8 looks like this (requested with token) It seems that i´m now in the same situation as with the secure link plugin from nginx. Can you please tell me what i´m doing wrong? Thanks a lot. |
I red your post again and i think i have to include the secure module, not only the validation. I need a break and will try tomorrow again :) |
yup, you need to use nginx-secure-token-module to embed tokens in the response, here is a sample config you can use: in our config we set all the parameters in the 'server' level in nginx.conf except 'secure_token akamai' which we enable only in specific locations. We have some locations that have Akamai tokens, some CF tokens, and some without tokens at all, so it's convenient to avoid copying the parameters between all akamai tokenized locations, for example. |
YES! it works perfectly now....I have now understood the in and outs of the token modules. I will now try to run elastic search, logstash and kibana on top. So amazing to see whats possible with the kaltura stuff. Thanks for all the help! |
@erankor, you stated before:
There's actually a neat trick in the nginx docs to only sign and validate the base of the URI, at http://nginx.org/en/docs/http/ngx_http_hls_module.html#hls_forward_args Given a config like so:
You can now generate a link secret using without specifying .ts/.m3u8 at the end and the nginx module would only have to reproduce the arguments to the m3u8 file in the playlist (so they are reflected to nginx for accessing the .ts files). |
Nice, thanks for sharing. |
erankor, sorry very much, but where need to change regular expr. (.*)/[^/]+ ?
|
like this:
|
Don't write arguments to m3u8 :( #EXTINF:2.000, |
I don't understand what you mean |
I enable secure link mod. m3u8 file need to be like right? but generated m3u8 file is #EXTINF:2.000, |
I believe you can configure it so that the token will be on the path of the URL instead of the query string, and then it will propagate to the segments. But anyway, as previously said, we are working with a CDN so we don't use nginx's secure link. |
sorry for bother you, but i have a problem when using akamai token validator plugin.
test the link to /hls/sample/Football_Made_in_Brazil_Trailer.mp4/master.m3u8 - gave me a 403 forbidden
Then i receive this request the hls master.m3u8 like this i saw a 403 forbidden in the access.log file Thanks a lot. |
Add to the script:
What happens is that the |
It 's still not worked. In log format : i add variable $secure_token_baseuri to detect baseuri |
It worked Thanks a lot |
sorry for bother you again. I try to turn on validate ip_address of client ( diffirent url per IP ) But it 's not work . I can play anylinks generated by PHP script above with any ip . |
IP validation is not implemented, see the last comment here - kaltura/nginx-akamai-token-validate-module#5 (comment) |
@erankor |
@pakitv, I don't follow, let you know what? |
i checked your nginx-vod module and it works great with the kaltura services.
i do not know if this is an issue to report, but when we enable the nginx secure link function:
secure_link $arg_checksum,$arg_timestamp;
master looks like:
.../master.m3u8?timestamp=DefinedInMS&checksum=md5checksum, this is going thru the validation process of the internal secure link function of nginx. After this the kaltura VOD-module redirects to:
./index-v1-a1.m3u8
"GET ....index-v1-a1.m3u8".....gives a 501 error,
referer was from "/master.m3u8?timestamp=1430348566&md5checksum=PG4LipwVIkqCKLmpjKFTHQ"
As you can see, it works for the kaltura-vod-module generated master.m3u8 for hls streaming, but the redirected single index.m3u8 playlist cuts out all arguments that where transferred and validated with the MD5 checksum of the first request.
Is there a way that you please fix that, maybe with an flag to enable and pass thru the arguments in the generated index m3u8 files?
i tested also the dash,hds and mss, same result here.
thanks.
The text was updated successfully, but these errors were encountered: