Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alfred2g committed Dec 3, 2023
1 parent 099fcc7 commit 39b6efe
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions samples/mqtt/websocket_connect/README_custom_auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,29 +39,29 @@ For this sample, using Websockets will attempt to fetch the AWS credentials to a
<details>
<summary> (code snipet to replace similar section)</summary>
<pre language="c++"> <code>
Utils::cmdData cmdData = Utils::parseSampleInputCustomAuthorizerConnect(argc, argv, &apiHandle);
Utils::cmdData cmdData = Utils::parseSampleInputCustomAuthorizerConnect(argc, argv, &apiHandle);

// Create the MQTT builder and populate it with data from cmdData.
Aws::Iot::MqttClient client;
// Create the MQTT builder and populate it with data from cmdData.
Aws::Iot::MqttClient client;

Aws::Crt::Auth::CredentialsProviderChainDefaultConfig defaultConfig;
Aws::Crt::Auth::CredentialsProviderChainDefaultConfig defaultConfig;

std::shared_ptr<Aws::Crt::Auth::ICredentialsProvider> provider =
Aws::Crt::Auth::CredentialsProvider::CreateCredentialsProviderChainDefault(defaultConfig);
std::shared_ptr<Aws::Crt::Auth::ICredentialsProvider> provider =
Aws::Crt::Auth::CredentialsProvider::CreateCredentialsProviderChainDefault(defaultConfig);

Aws::Iot::WebsocketConfig websocketConfig((cmdData.input_signingRegion), provider);
Aws::Iot::WebsocketConfig websocketConfig((cmdData.input_signingRegion), provider);

auto clientConfigBuilder = Aws::Iot::MqttClientConnectionConfigBuilder(websocketConfig);
auto clientConfigBuilder = Aws::Iot::MqttClientConnectionConfigBuilder(websocketConfig);

clientConfigBuilder.WithEndpoint((cmdData.input_endpoint));
clientConfigBuilder.WithEndpoint((cmdData.input_endpoint));

clientConfigBuilder.WithCustomAuthorizer(
(cmdData.input_customAuthUsername),
(cmdData.input_customAuthorizerName),
(cmdData.input_customAuthorizerSignature),
(cmdData.input_customAuthPassword),
(cmdData.input_customTokenKeyName),
(cmdData.input_customTokenValue));
clientConfigBuilder.WithCustomAuthorizer(
(cmdData.input_customAuthUsername),
(cmdData.input_customAuthorizerName),
(cmdData.input_customAuthorizerSignature),
(cmdData.input_customAuthPassword),
(cmdData.input_customTokenKeyName),
(cmdData.input_customTokenValue));
</code><pre>
</details>

Expand All @@ -71,12 +71,12 @@ For this sample, using Websockets will attempt to fetch the AWS credentials to a

Options for custom auth
```
--custom_auth_username <str>
--custom_auth_authorizer_name <str>
--custom_auth_authorizer_signature <str>
--custom_auth_password <str>
--custom_auth_token_name <str>
--custom_auth_token_value <str>
--custom_auth_username <str>
--custom_auth_authorizer_name <str>
--custom_auth_authorizer_signature <str>
--custom_auth_password <str>
--custom_auth_token_name <str>
--custom_auth_token_value <str>
```

To run the websocket connect use the following command:
Expand Down

0 comments on commit 39b6efe

Please sign in to comment.