When LogInsight creates a built-in account, it typically activates the account through an email link. However, if the customer's environment does not have a mail server, they may wonder if it's possible to activate the account without one.
1.Create a local user through the vLI UI, taking "user01" as an example.
2.Connect with the admin user to obtain the Bearer Token.
curl -k -X POST https://example.fqdn.local:9543/api/v2/sessions -d '{"username":"admin","password":"example-password","provider":"Local"}'
return:
{"userId":"66322480-6407-48dd-b972-ee4e03368702","sessionId":"G0bx3gZ/Xpmp1gas3H5tom22pp6GdnT++2vtcYhMrJEL02MosnS5+76fy2FQ9I0Xfz30+tb4kO/GX5O7Yjl4XOHcC0UW0hV2wxKdBnVJbOkNjuBYeTRNyiw8TcqQWjvXBVBKg01yvRz3Y/4DRFrW","ttl":1800}
3.Obtain the user id.
root@example [ ~ ]# cqlsh-no-pass
Connected to loginsight at 127.0.0.1:9042
[cqlsh 6.1.0 | Cassandra 4.1.3 | CQL spec 3.4.6 | Native protocol v5]
Use HELP for help.
lisuper@cqlsh> use logdb;
lisuper@cqlsh:logdb> select id,status from user where user_name='user01' allow filtering;id | status
--------------------------------------+--------
f7b8f183-a898-4cc3-90b5-b9a626dd1258 | 1
4.Set a password for the target user via REST API
curl --location --request PATCH 'https://example.fqdn.local:9543/api/v2/users/f7b8f183-a898-4cc3-90b5-b9a626dd1258/password' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer G0bx3gZ/Xpmp1gas3H5tom22pp6GdnT++2vtcYhMrJEL02MosnS5+76fy2FQ9I0Xfz30+tb4kO/GX5O7Yjl4XOHcC0UW0hV2wxKdBnVJbOkNjuBYeTRNyiw8TcqQWjvXBVBKg01yvRz3Y/4DRFrW' \
--data '{"password": "example-password","unlock": true}'