How can I access Amazon Protected Content?

Hi there,

I use Amazon S3 as my data storage. I have protection policy set on my data, which require credentials to access it

Is there a way to add Amazon credentials to H5P plugin to access S3 protected media?

 

Thanks

thomasmars's picture

Hi,
This would require some developer work. The basic flow for retrieving media assets for content is that the content gets a base URL from the H5P plugin framework, then adds their own path to the base URL to construct the full path to the file that is being retrieved.

You can change the base URL that is sent from the H5P plugin framework, then redirect it to a endpoint on your server that you create an control. Catch all requests to this base URL endpoint and apply the headers or signature that is needed to access S3 then redirect the request there and return the response from the endpoint. This should be sufficient to access S3 protected media within H5P content.

Best regards, Thomas

I imagine many users would benefit from S3 access within H5P, it is so widely used, and allowing public S3 data access and merely linking to the S3 URL isn't a feasible or safe workaround.

FWIW, I was able to get an h5p audio player to play an S3 asset in moodle by the moodle administrator, but not by a normal user.
I created a url by adding media to the description field that looks like this:
https://mydomain.com/classroom/draftfile.php/5/user/draft/XXXXXXXX/filen...
then copied the url to the source file field in the audio content type.
It works-- for an admin level permissons but not normal user level.

I am not a developer so I do need assistance creating a solution. Thomas, do you know an h5p fluent developer who might want to provide a development quote and turnaround time? We're serious about getting this done. Thanks.

BV52's picture

Hi nvcacademy,

For the possiblity of funding for a feature please contact the core team directly through the contact form. I would suggest to place a reference to this thread.

-BV52