← Back to the chapter · Next detail →
Technical detail · MQTT Security Fundamentals
Mosquitto identity mapping, session IDs and credential renewal
Mosquitto is an MQTT broker, a routing service that authenticates clients and maps each verified identity to permissions for named message routes called topics.
For Mosquitto username-based access rules, a validated client certificate needs a defined mapping to a username. The broker can require a certificate and use its identity or subject as the username. Check this mapping before relying on a username-based permission pattern.
A client ID names a session, not an authenticated identity. Accepting another connection with the same ID disconnects the earlier client. Reused IDs can therefore produce connection churn that resembles a network problem. Keep the session name and the proof of identity distinct when diagnosing a sensor connection.
A token carries identity claims checked by the broker; its lifetime is a deployment decision. A renewal-load model may assume a reconnect at each renewal and report mean load for spread-out renewals. Synchronized renewals can cluster requests. An arbitrary lifetime index does not establish security or an optimum, and continued-session behavior after expiry depends on broker policy. Define replacement and rejection of old keys as part of the credential lifecycle.