update auth.md

This commit is contained in:
hengyunabc
2021-03-08 19:02:16 +08:00
parent 20a4a8e1d6
commit 93743ca834
2 changed files with 24 additions and 1 deletions
+13 -1
View File
@@ -46,6 +46,8 @@ Authentication result: true
### http api验证
#### Authorization Header方式(推荐)
Arthas 采用的是 HTTP 标准的 Basic Authorization,客户端请求时增加对应的header即可。
* 参考:[https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication)
@@ -57,4 +59,14 @@ Arthas 采用的是 HTTP 标准的 Basic Authorization,客户端请求时增
curl 'http://localhost:8563/api' \
-H 'Authorization: Basic YWRtaW46YWRtaW4=' \
--data-raw '{"action":"exec","command":"version"}'
```
```
#### URL 参数传递方式
为了方便各种特殊情况,支持了以 parameters 方式传递username和password。比如:
```bash
curl 'http://localhost:8563/api?password=admin' \
--data-raw '{"action":"exec","command":"version"}'
```
+11
View File
@@ -45,6 +45,8 @@ After success, you can directly connect to the web console.
### HTTP API Authentication
#### HTTP Authorization Header(recommended)
Arthas uses the HTTP standard Basic Authorization.
* Reference: [https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication)
@@ -55,4 +57,13 @@ For example, if the user name is: `admin` and the password is `admin`, the combi
curl 'http://localhost:8563/api' \
-H 'Authorization: Basic YWRtaW46YWRtaW4=' \
--data-raw '{"action":"exec","command":"version"}'
```
#### URL parameters
It supports passing username and password in parameters. such as:
```bash
curl 'http://localhost:8563/api?password=admin' \
--data-raw '{"action":"exec","command":"version"}'
```