Knowledge base
1000 FAQs, 500 tutorials and instructional videos. Here, there are only solutions!
Secure videos with a unique key
This guide explains how to protect imported videos on an Infomaniak VOD service using a unique key.
Introduction
- Please note that protection is only effective in the case of standard iframe integration and therefore through the use of the Infomaniak Player.
- Other access restrictions can be enabled: password | geoip
- You can manage the thumbnail images used when restricting access.
Protect a video with a unique key
You have the option to protect all media files in a folder by creating a token. This token will be unique for each of your visitors and must be passed as a parameter to your media file in order to limit access to it. Only you will be able to generate the unique key required for each user to view the videos. This key therefore allows you to authorize only those people who have been previously verified by you.
This allows you to control access to videos and authorize only certain people, while denying access to others; this is useful in cases such as pay-per-view or limited broadcasts. However, please note that you will need to develop the integration with your existing system.
If the hash is invalid, accessing the video will return a "403 forbidden" error page.
Enable restriction on the import folder
When a password is set once at the destination folder level, all new media imports will automatically include this setting when played. To configure this folder:
- Click here to access the management of your VOD/AOD on the Infomaniak Manager (need help?).
- Click directly on the name assigned to the product in question:

- Click on Media in the left-hand menu.
- Click on Media Management in the left-hand menu.
- Click on the icon to create a New folder:

- Give the folder a name.
- Click the blue button to Create the folder.
- Click on Settings:

- Click on the Restrictions tab.
- Disable the toggle switch if necessary to remove the inheritance from the parent folder, so you can configure your own rules for this specific folder.
- Enable the toggle switch to configure restriction by unique key.
- Click Save once you have configured the various desired options:

1. Create a VOD API token
To access the VOD API, you must first authenticate using a token (this only needs to be done once – it will be valid for all the folders you want to protect); refer to this other guide and then to the https://developer.infomaniak.com/getting-started#authentication documentation.
2. Create the playback token
This step must be performed on your website/application, and this token must be unique, meaning it should be generated for each visitor.
Therefore, it is important that the page responsible for generating the token does not have any caching enabled, in order to guarantee the token's uniqueness.
POST {{URL_14}}channel_id = 1227share_id = corresponds to the ID of your video
Example: https://api.vod2.infomaniak.com/res/embed/1jhvl2uqa5rdf.html
The list of parameters is available in the documentation https://developer.infomaniak.com/docs/api/post/channel/share/token
3. Using the unique token in a media
The token retrieved in step 2 above will be passed as a parameter to the media; it will be unique and therefore different for each visitor:
<iframe frameborder="0" width="720" height="360" src="{{URL_18}}" allowfullscreen></iframe>Link to this FAQ: https://faq.infomaniak.com/1366
Has this FAQ been helpful?