Stream Authorization ==================== When creating stream it is possible to provide authorization parameters for stream reference. This allows agent to access protected resources when fetching stream data. Authorization can be set on `create stream <_static/api.html#operation/createStream>`_ or `create group <_static/api.html#operation/createGroup>`_ requests The authorization parameters could be specified in two ways: 1. As login and password for basic authorization. - The `stream` reference will be transformed to include these credentials, for example: ``` http://example_url/stream ``` will be transformed to ``` http://user:pass@example_url/stream ``` - In case of `videofile` reference credentials will be included in headers of request to fetch stream data: ``` Authorization: Basic base64(user:pass) ``` 2. As a token for bearer authorization. - The `stream` reference will be transformed to include the token as a query parameter, for example: ``` http://example_url/stream ``` will be transformed to ``` http://example_url/stream?jwt=token_value ``` - In case of `videofile` reference token will be included in headers of request to fetch stream data: ``` Authorization: Bearer token_value ``` Within database `password` and `bearer` values will be encrypted. To set secret key use `FERNET_PASSPHRASE` environment variable. **Note: The authorization headers are sent for both `stream` and `videofile` reference types in any case if authorization is set.**