Playback video encrypted by Azure Media Service wi

2019-09-09 00:00发布

问题:

I follow the step in the Azure Doc(Using AES-128 Dynamic Encryption and Key Delivery Service) and published a video by using the .NET SDK. However, I don't know how to use the token generated to play the encrypted content. In the other word, I don't know how to request key with token.

I read some related parts in the HTTP Live Streaming draft-pantos-http-live-streaming-13 and it seems that the clients(I think it means the browsers which supports HLS) will automatically get the key and do the decryption, so how can I provide the token while it pull the key from the delivery server automatically?

回答1:

you can read following articles to see token auth usage in azure media services and how to configure acs to issue tokens:

  • An End-to-End Prototype of AES Encryption with ACS Authentication and ACS Token Authorization
  • How to configure ACS with Media Services key services

If you want to issue SWT token yourself you can see sample implementation of SWT token here

We are working on crafting more samples and i will update thread once we will release them.



回答2:

Well,finally I find out the solution by (fiddlr), quite a great tool.

Just put your token in header with key authorization,just like

authorization:Bearer=zone=az&Audience=urn%3atest&ExpiresOn=1418623783&Issuer=http%3a%2f%2fblog.tivo.com%2f&HMACSHA256=txxxxxxxxxxxxxxcF1GYUw%3d

I'll attach some sample for how to generated a token later.