question

Travis avatar image
Travis asked

HTTP Headers - Secure HLS

I am trying to do the following using the Fire TV App Builder... Have my Firestick send out HTTP headers to Cloudfront so it will only access content based upon a specific header sent from the device to access a m3u8 file. Once it has the file, it will find that the TS files are encrypted and with the HLS spec, point back to the URL listed in the m3u8 file to access the encryption key. Before it sends the request, I want to display somewhere the device ID of the amazon fire tv. The device ID will be send via HTTP header (in https) to the Key URL server where it will only return the key back to the Amazon Fire TV if it finds a valid device ID for the resource it is seeking to acquire. (I know how to restrict headers on cloudfront, and have everything handled on the key-server end). This is so I can lock the content to a PER device.

In short, looking to put a device id label on screen & submit the device id via HTTP headers, with the whole processes in HTTPS. Seems real straightforward for the Guru's. Thanks for the help, hopefully this will help someone else out as well!

fire tvhelpfire app builder
10 |3000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Travis avatar image
Travis answered

Answering My Own Question Partially...

Open Up Utils -> Java -> com -> amazon -> android -> utils -> NetworkUtils.java


Add this line:

urlConnection.setRequestProperty("Your Key","Your Parameter");

After

URLConnection urlConnection = url.openConnection();

On the

public static String getDataLocatedAtUrl

routine :)

So Now.. I am still stuck trying to pass an advertising ID thru the URL connection. Any ideas?

10 |3000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Levon@Amazon avatar image
Levon@Amazon answered

Hi Travis,

You can get the Device ID by using Android ID, please see https://stackoverflow.com/questions/2785485/is-there-a-unique-android-device-id .
If you can't get the Android ID, you can create a unique hash ID as device ID, e.g.:

customDeviceId = UUID.randomUUID().toString()+System.currentTimeMillis(); 

Then you save the device ID in database or other places, and send it with HTTP header. Thanks!

10 |3000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.