Skip to content

feat(cli): implement SCRAM enhanced authentication for MQTT 5.0#1985

Merged
Red-Asuka merged 2 commits intomainfrom
ysf/cli
Sep 29, 2025
Merged

feat(cli): implement SCRAM enhanced authentication for MQTT 5.0#1985
Red-Asuka merged 2 commits intomainfrom
ysf/cli

Conversation

@ysfscream
Copy link
Copy Markdown
Member

@ysfscream ysfscream commented Sep 29, 2025

What is the current behavior?

MQTTX CLI currently only supports basic username/password authentication for MQTT connections. It lacks support for MQTT 5.0 enhanced authentication mechanisms like SCRAM (Salted Challenge Response Authentication Mechanism), which provides stronger security through challenge-response protocols and salted password hashing.

What is the new behavior?

This PR implements SCRAM enhanced authentication support for MQTTX CLI, adding support for:

  • SCRAM-SHA-1: SHA-1 based SCRAM authentication
  • SCRAM-SHA-256: SHA-256 based SCRAM authentication
  • SCRAM-SHA-512: SHA-512 based SCRAM authentication

New CLI Usage:

# Connect with SCRAM-SHA-256 authentication
mqttx conn -h broker.emqx.io -p 1883 -u username -P password --authentication-method SCRAM-SHA-256

# Publish with SCRAM authentication
mqttx pub -h broker.emqx.io -t topic -m "message" -u username -P password -am SCRAM-SHA-1

# Subscribe with SCRAM authentication
mqttx sub -h broker.emqx.io -t topic -u username -P password --authentication-method SCRAM-SHA-512

Key Features:

  • Full MQTT 5.0 enhanced authentication flow implementation
  • Integration with existing CLI commands (conn, pub, sub, benchConn, benchPub, benchSub)

Add support for SCRAM-SHA-1, SCRAM-SHA-256, and SCRAM-SHA-512 authentication methods with comprehensive test coverage and CLI integration.
@ysfscream ysfscream added this to the v1.12.1 milestone Sep 29, 2025
@ysfscream ysfscream requested a review from Red-Asuka September 29, 2025 03:06
@ysfscream ysfscream self-assigned this Sep 29, 2025
@ysfscream ysfscream added this to MQTTX Sep 29, 2025
@ysfscream ysfscream added enhancement New feature or request feature This pr is a feature CLI MQTTX CLI labels Sep 29, 2025
@ysfscream ysfscream moved this to In Progress in MQTTX Sep 29, 2025
@Red-Asuka Red-Asuka merged commit 0c059c6 into main Sep 29, 2025
8 checks passed
@Red-Asuka Red-Asuka deleted the ysf/cli branch September 29, 2025 05:36
@github-project-automation github-project-automation Bot moved this from In Progress to Done in MQTTX Sep 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLI MQTTX CLI enhancement New feature or request feature This pr is a feature

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants