|
|
5 лет назад | |
|---|---|---|
| .. | ||
| include | 0cd1c57a54 Migrate plugins from tag 4.2.2 | 5 лет назад |
| priv | 0cd1c57a54 Migrate plugins from tag 4.2.2 | 5 лет назад |
| src | 0cd1c57a54 Migrate plugins from tag 4.2.2 | 5 лет назад |
| test | 0cd1c57a54 Migrate plugins from tag 4.2.2 | 5 лет назад |
| README.md | 0cd1c57a54 Migrate plugins from tag 4.2.2 | 5 лет назад |
| TODO | 0cd1c57a54 Migrate plugins from tag 4.2.2 | 5 лет назад |
| rebar.config | 0cd1c57a54 Migrate plugins from tag 4.2.2 | 5 лет назад |
Authentication with ClientId and Password
make && make tests
etc/emqx_auth_clientid.conf:
## Password hash.
##
## Value: plain | md5 | sha | sha256
auth.client.password_hash = sha256
List all clientids:
# Request
GET api/v4/auth_clientid
# Response
{
"code": 0,
"data": ["clientid1"]
}
Add clientid:
# Request
POST api/v4/auth_clientid
{
"clientid": "a_client_id",
"password": "password"
}
# Response
{
"code": 0
}
Update password for a clientid:
# Request
PUT api/v4/auth_clientid/$CLIENTID
{
"password": "password"
}
# Response
{
"code": 0
}
Lookup a clientid info:
# Request
GET api/v4/auth_clientid/$CLIENTID
# Response
{
"code": 0,
"data": {
"clientid": "a_client_id",
"password": "hash_password"
}
}
Delete a clientid:
# Request
DELETE api/v4/auth_clientid/$CLIENTID
# Response
{
"code": 0
}
./bin/emqx_ctl plugins load emqx_auth_clientid
Apache License Version 2.0
EMQ X Team.