Git Product home page Git Product logo

emqx-auth-clientid's Introduction

emqx_auth_clientid

Authentication with ClientId and Password

Build

make && make tests

Configuration

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
}

Load the Plugin

./bin/emqx_ctl plugins load emqx_auth_clientid

License

Apache License Version 2.0

Author

EMQX Team.

emqx-auth-clientid's People

Contributors

emqplus avatar gilbertwong96 avatar hjianbo avatar huangdan avatar linjunjj avatar phanimahesh avatar rory-z avatar spring2maz avatar terry-xiaoyu avatar tigercl avatar wwhai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

emqx-auth-clientid's Issues

How can i specify pub/sub topics?

I set

auth.client.1.clientid = c1
auth.client.1.password = c1pwd

i am getting

22:19:54.877 [error] gen_server <0.1272.0> terminated with reason: {{badmap,undefined},[{maps,get,[<<"subscribe">>,undefined,[]],[{file,"maps.erl"},{line,192}]},{emq_acl_mongo,topics,2,[{file,"src/emq_acl_mongo.erl"},{line,58}]},{emq_acl_mongo,check_acl,2,[{file,"src/emq_acl_mongo.erl"},{line,41}]},{emqttd_access_control,check_acl,4,[{file,"src/emqttd_access_control.erl"},{line,85}]},{emqttd_protocol,'-process/2-lc$^0/1-0-',2,[{file,"src/emqttd_protocol.erl"},{line,250}]},{emqttd_protocol,process,2,[{file,"src/emqttd_protocol.erl"},{line,250}]},{emqttd_client,...},...]}
22:19:54.877 [error] CRASH REPORT Process <0.1272.0> with 0 neighbours exited with reason: {{badmap,undefined},[{maps,get,[<<"subscribe">>,undefined,[]],[{file,"maps.erl"},{line,192}]},{emq_acl_mongo,topics,2,[{file,"src/emq_acl_mongo.erl"},{line,58}]},{emq_acl_mongo,check_acl,2,[{file,"src/emq_acl_mongo.erl"},{line,41}]},{emqttd_access_control,check_acl,4,[{file,"src/emqttd_access_control.erl"},{line,85}]},{emqttd_protocol,'-process/2-lc$^0/1-0-',2,[{file,"src/emqttd_protocol.erl"},{line,250}]},{emqttd_protocol,process,2,[{file,"src/emqttd_protocol.erl"},{line,250}]},{emqttd_client,...},...]} in gen_server2:terminate/3 line 1157
22:19:54.878 [error] Supervisor 'esockd_connection_sup - <0.1191.0>' had child connection started with emqttd_client:start_link([{client_idle_timeout,30000},{client_enable_stats,false},{max_clientid_len,1024},{max_packet_size,...}]) at <0.1272.0> exit with reason {{badmap,undefined},[{maps,get,[<<"subscribe">>,undefined,[]],[{file,"maps.erl"},{line,192}]},{emq_acl_mongo,topics,2,[{file,"src/emq_acl_mongo.erl"},{line,58}]},{emq_acl_mongo,check_acl,2,[{file,"src/emq_acl_mongo.erl"},{line,41}]},{emqttd_access_control,check_acl,4,[{file,"src/emqttd_access_control.erl"},{line,85}]},{emqttd_protocol,'-process/2-lc$^0/1-0-',2,[{file,"src/emqttd_protocol.erl"},{line,250}]},{emqttd_protocol,process,2,[{file,"src/emqttd_protocol.erl"},{line,250}]},{emqttd_client,...},...]} in context connection_crashed


配置未生效

通过API添加客户端,然而客户端依然能连接。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.