Skip to content

Commit d2daec1

Browse files
committed
Change authentication method
1 parent f0823a9 commit d2daec1

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

articles/iot-operations/create-edge-apps/howto-develop-mqttnet-apps.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The [sample code](https://github.com/Azure-Samples/explore-iot-operations/tree/m
2929
var mqttClient = mqttFactory.CreateMqttClient();
3030
```
3131

32-
1. The following Kubernetes pod specification mounts the service account token to the specified path on the container file system. The mounted token is used as the password with well-known username `$sat`:
32+
1. The following Kubernetes pod specification mounts the service account token to the specified path on the container file system. The mounted token is used as the password with well-known username `K8S-SAT`:
3333

3434
```csharp
3535
string token_path = "/var/run/secrets/tokens/mqtt-client-token";
@@ -51,7 +51,7 @@ The [sample code](https://github.com/Azure-Samples/explore-iot-operations/tree/m
5151
.WithTcpServer(broker, 1883)
5252
.WithProtocolVersion(MqttProtocolVersion.V500)
5353
.WithClientId("sampleid")
54-
.WithCredentials("$sat", satToken)
54+
.WithCredentials("K8S-SAT", satToken)
5555
.Build();
5656
```
5757

articles/iot-operations/create-edge-apps/tutorial-event-driven-with-dapr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ To verify the MQTT bridge is working, deploy an MQTT client to the cluster.
211211
1. Subscribe to the `sensor/window_data` topic to observe the published output from the Dapr application:
212212

213213
```bash
214-
mosquitto_sub -L mqtts://aio-mq-dmqtt-frontend/sensor/window_data -u '$sat' -P $(cat /var/run/secrets/tokens/mqtt-client-token) --cafile /var/run/certs/aio-mq-ca-cert/ca.crt
214+
mosquitto_sub -L mqtts://aio-mq-dmqtt-frontend/sensor/window_data -u 'K8S-SAT' -P $(cat /var/run/secrets/tokens/mqtt-client-token) --cafile /var/run/certs/aio-mq-ca-cert/ca.crt
215215
```
216216

217217
1. Verify the application is outputting a sliding windows calculation for the various sensors every 10 seconds:

articles/iot-operations/manage-mqtt-broker/howto-configure-authentication.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ BrokerListener and BrokerAuthentication are separate resources, but they're link
5656

5757
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.
5858

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.
6060

6161
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.
6262

@@ -92,7 +92,7 @@ The earlier example specifies custom and SAT. When a client connects, MQTT broke
9292

9393
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.
9494

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.
9696

9797
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.
9898

@@ -400,7 +400,7 @@ MQTT v5 clients authenticated with SATs and custom authentication can reauthenti
400400

401401
Clients can reauthenticate by sending an MQTT v5 AUTH packet.
402402

403-
SAT clients send an AUTH client with the fields `method: $sat`, `data: <token>`.
403+
SAT clients send an AUTH client with the fields `method: K8S-SAT`, `data: <token>`.
404404
Custom authentication clients set the method and data field as required by the custom authentication server.
405405

406406
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.

0 commit comments

Comments
 (0)