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
+15-6Lines changed: 15 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -277,7 +277,9 @@ Apply your changes with `kubectl apply`. It might take a few minutes for the cha
277
277
278
278
### Test SAT authentication
279
279
280
-
SAT authentication must be used from a client in the same cluster as MQTT broker. The following command specifies a pod that has the mosquitto client and mounts the SAT created in the previous steps into the pod.
280
+
SAT authentication must be used from a client in the same cluster as MQTT broker. Only enhanced authentication fields are permitted. Set authentication method to `K8S-SAT` and authentication data to the token.
281
+
282
+
The following command specifies a pod that has the mosquitto client and mounts the SAT created in the previous steps into the pod.
281
283
282
284
```yaml
283
285
apiVersion: v1
@@ -306,21 +308,28 @@ spec:
306
308
307
309
Here, the `serviceAccountName` field in the pod configuration must match the service account associated with the token being used. Also, The `serviceAccountToken.audience` field in the pod configuration must be one of the `audiences` configured in the BrokerAuthentication resource.
308
310
309
-
Once the pod has been created, start a shell in the pod:
311
+
Once the pod is created, start a shell in the pod:
310
312
311
313
```bash
312
314
kubectl exec --stdin --tty mqtt-client -n azure-iot-operations -- sh
313
315
```
314
316
315
-
The token is mounted at the path specified in the configuration `/var/run/secrets/tokens` in the previous example. Retrieve the token and use it to authenticate.
317
+
Inside the pod's shell, runthe following command to publish a message to the broker:
The MQTT username must be set to `$sat`. The MQTT password must be set to the SAT itself.
332
+
The mosquitto client uses the service account token mounted at `/var/run/secrets/tokens/mq-sat` to authenticate with the broker. The token is valid for 24 hours. The client also uses the default root CA cert mounted at `/var/run/certs/ca.crt` to verify the broker's TLS certificate chain.
0 commit comments