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: README.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -368,6 +368,7 @@ follows:
368
368
*`customAuthHeaders`: used to specify your custom authorization headers when `protocol` is set to 'wss-custom-auth'. The fields 'X-Amz-CustomAuthorizer-Name', 'X-Amz-CustomAuthorizer-Signature', and the field for your token name are required.
369
369
*`servername`: used for SNI. If undefined, a value is derived from `host`.
370
370
*`port`: used to specify which port to connect to. If undefined, 443 or 8883 will be chosen depending on `protocol`.
371
+
*`customAuthQueryString`: used to specify the token credentials in a query string for custom authorization when `protocol` is set to `wss-custom-auth`. More info can be found [here](https://docs.aws.amazon.com/iot/latest/developerguide/custom-auth.html#custom-auth-websockets).
371
372
*`keepalive`: used to specify the time interval for each ping request. Default is set to 300 seconds to connect to AWS IoT.
372
373
*`enableMetrics`: used to report SDK version usage metrics. It is set to true by default. To disable metrics collection, set value to false.
373
374
*`debug`: set to 'true' for verbose logging (default 'false').
@@ -746,8 +747,8 @@ set the `protocol` option to `wss-custom-auth`.
746
747
### Custom Authorization Configuration
747
748
748
749
To use custom authorization, you must first set up an authorizer function in Lambda and register it
749
-
with IoT. Once you do, you will be able to authenticate using this function. To use custom auth,
750
-
set the `customAuthHeaders` option to your headers object when instantiating the [awsIotDevice()](#device)
750
+
with IoT. Once you do, you will be able to authenticate using this function. There are two ways to use custom auth:
751
+
*set the `customAuthHeaders` option to your headers object when instantiating the [awsIotDevice()](#device)
751
752
or [awsIot.thingShadow()](#thingShadow) classes. The headers object is an object containing the header name
752
753
and values as key-value pairs:
753
754
@@ -758,6 +759,11 @@ and values as key-value pairs:
758
759
'TestAuthorizerToken':'token'
759
760
}
760
761
```
762
+
* set the `customAuthQueryString` option to your headers object when instantiating the [awsIotDevice()](#device) class. The query string is a string containing the values as key-value pairs:
0 commit comments