MQTT 5.0 Enhanced Authentication

EMQX also supports the MQTT 5.0 enhanced authentication. This authenticator implements Salted Challenge Response Authentication Mechanism (SCRAM)MQTT 5.0 Enhanced Authentication - 图1 (opens new window) authentication and uses the built-in database of EMQX to store client credentials (users).

SCRAM is a more complicated mechanism than password verification. It requires exchanging additional MQTT packages during connection. SCRAM authentication does not depend on external data sources, and it is simple and lightweight to use.

TIP

SCRAM authenticator only supports MQTT 5.0 connection.

Configure with Dashboard

On EMQX DashboardMQTT 5.0 Enhanced Authentication - 图2 (opens new window), click Access Control -> Authentication on the left navigation tree to enter the Authentication page. Click Create at the top right corner, then click to select SCRAM as Mechanism, and Built-in Database as Backend, this will lead us to the Configuration tab.

Set Password Hash as sha256 or sha512 and click Create to finish the settings.

Configure with Configuration Items

Sample configuration:

  1. {
  2. mechanism = scram
  3. backend = built_in_database
  4. enable = true
  5. algorithm = sha512
  6. iteration_count = 4096
  7. }

where,

  • algorithm: password hash algorithm, options: sha256 and sha512
  • iteration_count (optional): Iteration-count parameter for SCRAM; Default: 4096