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 to an existing broker.
- Select Yandex IoT Core.
- Select the broker.
- 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. Don't forget to save your password, you'll need it.
- Click Add.
If you don't 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: areuu2hgsv6klgbd4e6d created_at: "2019-12-16T15:32:46.655139Z"
You can add a broker password using the API addPassword method.
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 don't 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**********
You can set a broker password when creating it using the API create method.
Getting a list of broker passwords
- In the management console, select the folder where you want to get a list of broker passwords.
- Select Yandex IoT Core.
- Select the broker.
- On the Overview page, go to the Passwords section.
If you don't 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 | +----------------------+---------------------+
You can get a list of broker passwords using the API listPasswords method.
Deleting a broker password
- In the management console, select the folder to delete the broker password from.
- Select Yandex IoT Core.
- Select the broker.
- In the row with the password you need, click
- In the window that opens, click Delete.
If you don't 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 are0gffs957egmoksgf4
-
Make sure that the password was deleted:
yc iot broker password list --broker-name broker-with-pass
Result:
+----+------------+ | ID | CREATED AT | +----+------------+ +----+------------+
You can delete a broker password using the API deletePassword method.