Skip to content

Add support for HTTP Basic authentication - #812

Open
bsriramprasad wants to merge 12 commits into
developmentfrom
feat/add-https-basic-auth
Open

Add support for HTTP Basic authentication#812
bsriramprasad wants to merge 12 commits into
developmentfrom
feat/add-https-basic-auth

Conversation

@bsriramprasad

@bsriramprasad bsriramprasad commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Add support for HTTP Basic authentication only over TLS-protected connections (RFC 7617)

Motivation

As ONVIF devices increasingly operate in cloud-connected and TLS-only deployments, the current specification's exclusive reliance on HTTP Digest authentication creates friction for modern integration patterns:

  • Cloud and proxy architectures: Digest authentication cannot be proxied transparently. Because the response hash is bound to the request URI and to a device-issued nonce, any intermediary that rewrites paths or distributes requests across workers must terminate and re-originate authentication itself — holding password-equivalent credentials for each device and maintaining per-device auth state. Basic authentication, being stateless and path-independent, forwards unchanged, which simplifies cloud-based device access at the cost of requiring TLS
    with proper certificate validation end to end.

  • Regulatory direction: Frameworks such as the EU Cyber Resilience Act and NIS2 impose secure-by-design and risk-management obligations that are pushing deployments toward encrypted-by-default transport, making TLS-everywhere an increasingly common baseline.

  • Simplified authentication stack: Organizations enforcing TLS-only access can use Basic over TLS rather than maintaining Digest challenge-response infrastructure alongside TLS termination.

  • Interoperability with standard HTTP clients and tooling: HTTP Basic is universally supported across HTTP client libraries, browsers, and automation tooling without custom Digest handling.

This change introduces HTTP Basic authentication as an optional, TLS-only feature with an explicit capability signal (HttpBasic).

Compatibility Analysis

Aspect Impact
Backward compatible A device supporting Basic shall also support digest and include a Digest challenge in every 401 response. Existing Digest-only clients see unchanged behaviour and need not be aware of Basic.
Capability signalling HttpBasic is optional; per existing Core convention, an omitted capability indicates the device does not support it.
Profiles No profile requirements change. HTTP digest remains mandatory wherever profile specifications require it; this PR does not amend any profile document.
Discovery Clients negotiate via the WWW-Authenticate challenge as HTTP requires; the capability is for configuration and planning, not negotiation.
Schema New optional HttpBasic boolean attribute in devicemgmt.wsdl (GetServiceCapabilities path).
Security Service No changes. All edits are scoped to Core and the Device Management WSDL.

Summary of Changes

doc/Core.xml

Section Change
Normative references Added RFC 7617
Authentication over HTTP and HTTPS Added HTTP Basic over TLS-protected connections as an authentication exception alongside existing exceptions (WS-UsernameToken, TLS client auth, JWT)
Authentication over HTTP and HTTPS Added three normative requirements for devices supporting Basic: accept preemptive credentials, offer a Basic challenge only over TLS, and continue to offer Digest in every 401
Authentication over HTTP and HTTPS Listed HTTP Basic over TLS-protected connections as an accepted authentication method for RTSP and HTTP methods
GetServiceCapabilities table Added HttpBasic row to Security capabilities (updated morerows count)
Appendix (new) HTTP Basic challenge-response example over a TLS-protected connection
Revision history Added entry

wsdl/ver10/device/wsdl/devicemgmt.wsdl

Section Change
SecurityCapabilities Added HttpBasic boolean attribute

References

@bsriramprasad bsriramprasad changed the title Add support for HTTP Basic authentication over HTTPS (RFC 7617) Feature : HTTP Basic authentication over HTTPS (RFC 7617) Aug 4, 2026
@bsriramprasad bsriramprasad changed the title Feature : HTTP Basic authentication over HTTPS (RFC 7617) HTTP Basic authentication over HTTPS (RFC 7617) Aug 4, 2026
@bsriramprasad bsriramprasad changed the title HTTP Basic authentication over HTTPS (RFC 7617) Add support for HTTP Basic authentication Aug 4, 2026
Comment thread wsdl/ver10/device/wsdl/devicemgmt.wsdl Outdated
Comment thread doc/Core.xml Outdated
protect bearer tokens against replay attacks.</para>
<para>An ONVIF compliant device should authenticate an RTSP request at the RTSP level. If HTTP is used to tunnel the RTSP request the device shall not authenticate on the HTTP level.</para>
<para>When authenticating RTSP or HTTP methods, an ONVIF compliant device shall use digest authentication [RFC 2617] or JWT-based authorization. The credentials shall be managed with the GetUsers, CreateUsers, DeleteUsers and SetUser methods. If the device also supports WS-Security, the same set of credentials shall be used.</para>
<para>When authenticating RTSP or HTTP methods, an ONVIF compliant device shall use digest authentication [RFC 2617], HTTP Basic authentication [RFC 7617] or JWT-based authorization. The credentials shall be managed with the GetUsers, CreateUsers, DeleteUsers and SetUser methods. If the device also supports WS-Security, the same set of credentials shall be used.</para>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is HTTP Basic authentication really to be applicable for RTSP?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional clarification on usage of basic for RTSP

image

@MariaYa0091

Copy link
Copy Markdown

General note:

It could a bit of backward compatibility issue for clients. They could expect no HTTP digest for HTTPS connection (as it was required before).

Also for all currently existing profiles using of HTTP digest for HTTPS to be the expected behavior. There were no exceptions before.

@bsriramprasad

Copy link
Copy Markdown
Contributor Author

General note:

It could a bit of backward compatibility issue for clients. They could expect no HTTP digest for HTTPS connection (as it was required before).

Also for all currently existing profiles using of HTTP digest for HTTPS to be the expected behavior. There were no exceptions before.

Latest changes addresses your concern.

@ocampana-videotec

Copy link
Copy Markdown
Collaborator

@bsriramprasad what problem are we trying to? I am not a fan of HTTP basic auth, de facto it is equivalent of removing the password. We already had issues in the past with profile Q, I have the feeling we are repeating the story here.

Small provocation: isn't certificate based client authentication enough?

Adding Basic Auth will imply that by mistake vendor will implement HTTP + Basic Auth, you can take this for granted.

@bsriramprasad

bsriramprasad commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

@ocampana-videotec

Auth will imply that by mistake vendor will implement HTTP + Basic Auth, you can take this for granted.

Good point! Agreed, and that is why the constraint has to be testable rather than advisory. Profile Q's mitigation was a deployment guidance page. This one is normative and checkable — the updated requirements text is in the PR and explained here for coherent PR discussion

  1. Accept preemptive Basic credentials over a TLS-protected connection;
  2. Include a Basic challenge only in 401 responses sent over a TLS-protected connection;
  • A device that advertises Basic over plain HTTP fails this requirement.
  1. Respond 401 with a Digest-only challenge when Basic credentials arrive over a non-TLS connection;
  • A device that accepts Basic over plain HTTP fails this requirement;
  1. support digest authentication and include a Digest challenge in every 401 response.
  • A device that supports Basic-only fails this requirement.

Each requirement maps to a conformance assertion.

isn't certificate based client authentication enough?

mTLS binds authentication to the TLS connection. A gateway terminates TLS, so the client certificate never reaches the device, mTLS did not replace/deprecate digest and continues to be in core. Per-client certificate issuance, renewal, and revocation is also a substantial operational burden.

what problem are we trying to?

The problem we are addressing is interoperability with TLS-only deployments and architectures where Digest cannot be forwarded transparently through a proxy because it is bound to the request URI and server nonce. Mutual TLS is another valid option, but it requires client-certificate provisioning and is not equivalent to username/password authentication for existing clients and deployments.

Authentication mechanisms in ONVIF

Client → Device (inbound)

WS-UsernameToken HTTP Digest X.509 / TLS client cert JWT (Bearer) HTTP Basic (proposed)
Capability UsernameToken HttpDigest X.509Token JsonWebToken HttpBasic
ONVIF status Legacy Mandatory Optional Optional, HTTPS only Optional, TLS only
Works for RTSP No Yes Yes Yes Yes
Credential on wire SHA-1 digest MD5 digest Certificate Signed token Base64 password
Proxy-forwardable Yes No — bound to URI + device nonce No — bound to TLS connection Yes Yes
External infrastructure None None PKI + per-client lifecycle OIDC authorization server None
Identity managed by SetUser SetUser Keystore + validation policy SetJWTConfiguration + external issuer SetUser

Device → Authorization Server (outbound)

Defined in the ONVIF Security Service Specification for OAuth 2.0 client registration:

Method Credential Reference
client_secret_basic client_secret in HTTP Authorization header RFC 6749
client_secret_post client_secret in HTTP POST body RFC 6749
client_secret_jwt HMAC-signed JWT using client_secret OpenID Connect Core
private_key_jwt PKI-signed JWT using private key OpenID Connect Core
tls_client_auth mTLS with CA-issued X.509 certificate RFC 8705
self_signed_tls_client_auth mTLS with self-signed certificate RFC 8705

Gap addressed by this proposal. No existing inbound mechanism is simultaneously proxy-forwardable, based on device-local credentials, and free of external infrastructure.

  • Digest and TLS client certificates require no infrastructure but cannot be forwarded through an intermediary.
  • JWT forwards cleanly but requires an OpenID Connect authorization server.
  • WS-UsernameToken is SOAP-only and legacy.

Note on client_secret_basic. ONVIF already specifies HTTP Basic in the Authorization header over TLS as an accepted method for protecting the device's OAuth 2.0 client secret. The security judgement for Basic-over-TLS is therefore already established in the specification; this proposal applies the same judgement to the inbound direction, where TLS provides identical protection.

Bottomline : Basic is the only combination of stateless-forwardable, device-local credentials, and zero infrastructure.

@bsriramprasad
bsriramprasad marked this pull request as ready for review August 19, 2026 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants