Skip to content

Commit abc246c

Browse files
lukebakkenmkuratczyk
authored andcommitted
Add rabbitmqctl / HTTP API docs for hashing password
See rabbitmq/rabbitmq-server#7432
1 parent bafe924 commit abc246c

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

site/passwords.md

+22-3
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,29 @@ To do so:
161161

162162
## <a id="computing-password-hash" class="anchor" href="#computing-password-hash">Computing Password Hashes</a>
163163

164-
Sometimes it is necessary to compute a user's password hash, to updated via the [HTTP API](management.html)
165-
or generate a [definitions file](definitions.html) to import.
164+
Sometimes it is necessary to compute a user's password hash for updating via the [HTTP API](management.html)
165+
or to generate a [definitions file](definitions.html) to import.
166166

167-
This is the algorithm:
167+
### Hash via `rabbitmqctl`
168+
169+
<pre class="lang-bash">
170+
rabbitmqctl hash_password foobarbaz
171+
172+
# Output:
173+
# Will hash password foobarbaz
174+
# 27cx5+wEi8R8uwTeTr3hk5azuV3yYxxAtwPPhCyrbdsxVhqq
175+
</pre>
176+
177+
### Hash via HTTP API
178+
179+
<pre class="lang-bash">
180+
curl -4su guest:guest -X GET localhost:15672/api/auth/hash_password/foobarbaz
181+
182+
# Output:
183+
# {"ok":"TBybOvomyVw6BqBU/fHCEpVhDO7fLdQ4kxZDUpt6hagCxV8I"}
184+
</pre>
185+
186+
### This is the algorithm:
168187

169188
* Generate a random 32 bit salt. In this example, we will use `908D C60A`. When RabbitMQ creates or updates a user, a random salt is generated.
170189
* Concatenate the generated salt with the UTF-8 representation of the desired password.

0 commit comments

Comments
 (0)