how do I create a user with no tags via api?

75 views
Skip to first unread message

Caleb Cushing

unread,
Aug 23, 2019, 5:25:34 PM8/23/19
to rabbitmq-users
from the documentation

Newly created users do not have any tags set on them by default.
The tags key is mandatory.

ok, so if the tags key is mandatory when creating a user, how do I create a user without tags? worth saying, in case I'm asking the wrong question, all I want these users to be able to do is send/receive messages via mqtt.

Luke Bakken

unread,
Aug 23, 2019, 6:03:22 PM8/23/19
to rabbitmq-users
Hi Caleb,

See this curl transcript:

$ curl -4vvvu guest:guest -XPUT localhost:15672/api/users/test-user -d '{"password":"new-password","tags":""}'
*   Trying 127.0.0.1:15672...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 15672 (#0)
* Server auth using Basic with user 'guest'
> PUT /api/users/test-user HTTP/1.1
> Host: localhost:15672
> Authorization: Basic Z3Vlc3Q6Z3Vlc3Q=
> User-Agent: curl/7.65.3
> Accept: */*
> Content-Length: 37
> Content-Type: application/x-www-form-urlencoded
* upload completely sent off: 37 out of 37 bytes
* Mark bundle as not supporting multiuse
< HTTP/1.1 201 Created
< content-length: 0
< content-security-policy: default-src 'self'
< date: Fri, 23 Aug 2019 22:02:11 GMT
< server: Cowboy
< vary: accept, accept-encoding, origin
* Connection #0 to host localhost left intact

$ curl -4vvvu guest:guest localhost:15672/api/users/test-user
*   Trying 127.0.0.1:15672...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 15672 (#0)
* Server auth using Basic with user 'guest'
> GET /api/users/test-user HTTP/1.1
> Host: localhost:15672
> Authorization: Basic Z3Vlc3Q6Z3Vlc3Q=
> User-Agent: curl/7.65.3
> Accept: */*
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< cache-control: no-cache
< content-length: 150
< content-security-policy: default-src 'self'
< content-type: application/json
< date: Fri, 23 Aug 2019 22:02:23 GMT
< server: Cowboy
< vary: accept, accept-encoding, origin
* Connection #0 to host localhost left intact
{"name":"test-user","password_hash":"Cvm5r1JI/34pu6nOBeZbQBCc1PKwEtO93rWoCddKeDWnJTI9","hashing_algorithm":"rabbit_password_hashing_sha256","tags":""}

Caleb Cushing

unread,
Aug 26, 2019, 1:41:49 PM8/26/19
to rabbitmq-users
Thanks
Reply all
Reply to author
Forward
0 new messages