Managing broker passwords
Note
The broker is at the Preview stage.
To start exchanging messages between broker clients, you must log in. This section describes how to manage broker passwords for the relevant authorization method.
Note
When using an X.509 certificate along with a password, the password has higher priority.
Adding a password to a broker
You can add a password to an existing broker or set it when creating a broker using the --password
parameter.
Note
You can also set a password from the input stream. To do this, use the --read-password
flag instead of the --password
parameter.
Adding a password to an existing broker
- In the management console
, select the folder where you want to add a password for an existing broker. - Select IoT Core.
- In the left-hand panel, select Brokers.
- Select the appropriate broker from the list.
- Under Passwords, click Add password.
- In the Password field, enter the password you will use to access the broker. To create a password, you can use the password generator
. Make sure to save your password, as you will need it later. - Click Add.
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To add a password:
-
Get a list of brokers in the folder:
yc iot broker list
Result:
+----------------------+-------------------+ | ID | NAME | +----------------------+-------------------+ | arenou2oj4********** | my-broker | +----------------------+-------------------+
-
Add a password to the broker:
yc iot broker password add --broker-name my-broker --password Passw0rdForBroker
Result:
broker_id: arenou2oj4********** id: areuu2hgsv6k******** created_at: "2019-12-16T15:32:46.655139Z"
To add a password to a broker, use the addPassword REST API method for the Broker resource or the BrokerService/AddPassword gRPC API call.
Setting a password for a broker when creating it
For information about how to set a password for a broker when creating it, see Creating a broker.
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
Create a broker with a password:
yc iot broker create --name broker-with-pass --password Passw0rdForDevice
Result:
done (1s)
id: areg96c8lo**********
folder_id: b1g88tflru**********
created_at: "2019-12-16T15:34:25.563Z"
name: broker-with-pass
status: ACTIVE
log_group_id: ckghhil3b5**********
To set a password for a broker when creating it, use the create REST API method for the Broker resource or the BrokerService/Create gRPC API call.
Getting a list of broker passwords
- In the management console
, select the folder where you want to get a list of broker passwords. - Select IoT Core.
- In the left-hand panel, select Brokers.
- Select the appropriate broker from the list.
- On the Overview page, go to the Passwords section.
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To get a list of passwords:
-
Get a list of brokers in the folder:
yc iot broker list
Result:
+----------------------+--------------------+ | ID | NAME | +----------------------+--------------------+ | areg96c8lo********** | broker-with-pass | | arenou2oj4********** | my-broker | +----------------------+--------------------+
-
Get a list of broker passwords:
yc iot broker password list --broker-name broker-with-pass
Result:
+----------------------+---------------------+ | ID | CREATED AT | +----------------------+---------------------+ | are0gffs95********** | 2019-12-16 15:34:25 | +----------------------+---------------------+
To get a list of broker passwords, use the listPasswords REST API method for the Broker resource or the BrokerService/ListPasswords gRPC API call.
Deleting a broker password
- In the management console
, select the folder to delete the broker password from. - Select IoT Core.
- In the left-hand panel, select Brokers.
- Select the appropriate broker from the list.
- In the row with the password, click
and select Delete from the drop-down list. - In the window that opens, click Delete.
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To delete a password:
-
Get a list of broker passwords:
yc iot broker password list --broker-name broker-with-pass
Result:
+----------------------+---------------------+ | ID | CREATED AT | +----------------------+---------------------+ | are0gffs95********** | 2019-12-16 15:34:25 | +----------------------+---------------------+
-
Delete the password:
yc iot broker password delete --broker-name broker-with-pass --password-id are0gffs957e********
-
Make sure that the password was deleted:
yc iot broker password list --broker-name broker-with-pass
Result:
+----+------------+ | ID | CREATED AT | +----+------------+ +----+------------+
To delete a broker password, use the deletePassword REST API method for the Broker resource or the BrokerService/DeletePassword gRPC API call.