You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/iot-operations/manage-mqtt-broker/howto-configure-authentication.md
+22-3Lines changed: 22 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ ms.subservice: azure-mqtt-broker
7
7
ms.topic: how-to
8
8
ms.custom:
9
9
- ignite-2023
10
-
ms.date: 07/16/2024
10
+
ms.date: 07/26/2024
11
11
12
12
#CustomerIntent: As an operator, I want to configure authentication so that I have secure MQTT broker communications.
13
13
---
@@ -56,7 +56,7 @@ BrokerListener and BrokerAuthentication are separate resources, but they're link
56
56
57
57
The order of authentication methods in the array determines how MQTT broker authenticates clients. MQTT broker tries to authenticate the client's credentials using the first specified method and iterates through the array until it finds a match or reaches the end.
58
58
59
-
For each method, MQTT broker first checks if the client's credentials are *relevant* for that method. For example, SAT authentication requires a username starting with `$sat`, and X.509 authentication requires a client certificate. If the client's credentials are relevant, MQTT broker then verifies if they're valid. For more information, see the [Configure authentication method](#configure-authentication-method) section.
59
+
For each method, MQTT broker first checks if the client's credentials are *relevant* for that method. For example, SAT authentication requires a username starting with `K8S-SAT`, and X.509 authentication requires a client certificate. If the client's credentials are relevant, MQTT broker then verifies if they're valid. For more information, see the [Configure authentication method](#configure-authentication-method) section.
60
60
61
61
For custom authentication, MQTT broker treats failure to communicate with the custom authentication server as *credentials not relevant*. This behavior lets MQTT broker fall back to other methods if the custom server is unreachable.
62
62
@@ -92,7 +92,7 @@ The earlier example specifies custom and SAT. When a client connects, MQTT broke
92
92
93
93
1. If the custom authentication server responds with `Pass` or `Fail` result, the authentication flow ends. However, if the custom authentication server isn't available, then MQTT broker falls back to the remaining specified methods, with SAT being next.
94
94
95
-
1. MQTT broker tries to authenticate the credentials as SAT credentials. If the MQTT username starts with `$sat`, MQTT broker evaluates the MQTT password as a SAT.
95
+
1. MQTT broker tries to authenticate the credentials as SAT credentials. If the MQTT username starts with `K8S-SAT`, MQTT broker evaluates the MQTT password as a SAT.
96
96
97
97
If the custom authentication server is unavailable and all subsequent methods determined that the provided credentials aren't relevant, then the broker denies the client connection.
98
98
@@ -386,6 +386,25 @@ spec:
386
386
header_key: header_value
387
387
```
388
388
389
+
## Client disconnect after credentials expire
390
+
391
+
MQTT broker disconnects clients when their credentials expire. Disconnect after credential expiration applies to all clients that connect to the MQTT broker frontends including:
392
+
393
+
- Clients authenticated with SATs disconnect when their SAT expires
394
+
- Clients authenticated with X.509 disconnect when their client certificate expires
395
+
- Clients authenticated with custom authentication disconnect based on the expiry time returned from the custom authentication server.
396
+
397
+
On disconnect, the client's network connection is closed. The client won't receive an MQTT DISCONNECT packet, but the broker logs a message that it disconnected the client.
398
+
399
+
MQTT v5 clients authenticated with SATs and custom authentication can reauthenticate with a new credential before their initial credential expires. X.509 clients cannot reauthenticate and must re-establish the connection since authentication is done at the TLS layer.
400
+
401
+
Clients can reauthenticate by sending an MQTT v5 AUTH packet.
402
+
403
+
SAT clients send an AUTH client with the fields `method: K8S-SAT`, `data: <token>`.
404
+
Custom authentication clients set the method and data field as required by the custom authentication server.
405
+
406
+
Successful reauthentication updates the client's credential expiry with the expiry time of its new credential, and the broker responds with a *Success AUTH* packet. Failed authentication due to transient issues cause the broker to respond with a *ContinueAuthentication AUTH* packet. For example, the custom authentication server being unavailable. The client can try again later. Other authentication failures cause the broker to send a DISCONNECT packet and close the client's network connection.
407
+
389
408
## Related content
390
409
391
410
- About [BrokerListener resource](howto-configure-brokerlistener.md)
0 commit comments