Settings / Configuration
There are a number of settings that can be configured for MediaAuth. Settings are specified in the standard way the using appSettings.json file under the CanineMediaAuth
section.
For typical scenarios and usage you probably won't need to modify any of these settings as the default should suffiice.
Available Settings
Setting | Default Value | Description |
---|---|---|
DisableProtectionMiddleware | false | When true MediaAuth middleware is completely disabled allowing all files to be downloaded without authentication. |
CacheTimeoutMilliseconds | 3000 | Cache timeout in milliseconds for media auth protection items. |
IgnoredFileExtensions | [empty array] | Specified file extensions will be completely ignored by the MediaAuth middleware and a a result will not be protected. This can potentially improve performance in high load scenarios where you are sure certain file types will not need protection. |
LogAuthorisedProtecedMediaRequests | false | When true requests for protected media items will be logged to the Umbraco logs. |
LogUnauthorisedProtecedMediaRequests | false | When true unsuccessful requests for protected media items will be logged to the Umbraco logs. |
Example settings section from appSettings.json
"CanineMediaAuth": {
"DisableProtectionMiddleware": false,
"CacheTimeoutMilliseconds": 2500,
"IgnoredFileExtensions": [ "jpg", "png" ],
"LogAuthorisedProtecedMediaRequests": true,
"LogUnauthorisedProtecedMediaRequests": true
},