Stream Authorization

When creating stream it is possible to provide authorization parameters for stream reference. This allows Luna Video Agent to access protected resources when fetching stream data.

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 local agent 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 is authorization is set.

Warning: When retransmission fallback LUNA_VIDEO_AGENT_SETTINGS.retransmission_fallback is enabled, the ** `mediamtx` **logs could expose some sensitive information (token or password)