Comments (4)
@aep Can you help with this? You added it in #41 and I haven't had the oportunity to study; can you paste a snippet of config here please?
from mosquitto-auth-plug.
Fixed and closed in #63
from mosquitto-auth-plug.
Thank You. Will test and Let you know tonight.
from mosquitto-auth-plug.
Hello,
Thank You @jpmens and @oshoemaker Just tested it with following.. And it seems it works fine.
**pardon my limited skills in Redis.. if you can validate if I did it right or not, it would be great.
Setting in redis using redis-cli (is this method correct ?)
127.0.0.1:6379> set n2 <some_pasword_hash>
OK
127.0.0.1:6379> set "n2-hello/1" 2
OK
GDB output
$ gdb
GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
(gdb) exec-file /usr/local/sbin/mosquitto
(gdb) handle SIGILL nostop noprint
Signal Stop Print Pass to program Description
SIGILL No No Yes Illegal instruction
(gdb) run -c /etc/mosquitto/mosquitto.conf
Starting program: /usr/local/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
1426717945: |-- *** auth-plug: startup
1426717945: |-- ** Configured order: redis
1426717945: |-- }}}} Redis
1426717946: |-- mosquitto_auth_unpwd_check(n2)
1426717946: |-- ** checking backend redis
1426717946: |-- getuser(n2) AUTHENTICATED=1 by redis
1426719957: |-- mosquitto_auth_unpwd_check(n2)
1426719957: |-- ** checking backend redis
1426719957: |-- getuser(n2) AUTHENTICATED=1 by redis
1426719957: |-- mosquitto_auth_acl_check(..., mosqpub/13383-berryp, n2, hello/1, MOSQ_ACL_WRITE)
1426719957: |-- user n2 was authenticated in back-end 0 (redis)
1426719957: |-- aclcheck(n2, hello/1, 2) AUTHORIZED=1 by redis
1426719957: |-- Cached [45397CBD5E6611861D612C561E48B8D202A92A2A] for (mosqpub/13383-berryp,n2,2)
1426719957: |-- mosquitto_auth_acl_check(..., mqttwarn, anonymous, hello/1, MOSQ_ACL_READ)
1426719957: |-- aclcheck(anonymous, hello/1, 1) CACHEDAUTH: 12
1426719957: |-- mosquitto_auth_acl_check(..., mosqsub/13355-berryp, n2, hello/1, MOSQ_ACL_READ)
1426719957: |-- aclcheck(n2, hello/1, 1) CACHEDAUTH: 0
Mosquitto Sub
$ mosquitto_sub -t "hello/1" -u n2 -P password
hellothere <----Prints this once you publish message with Pub command below.
Mosquitto Pub
$ mosquitto_pub -t 'hello/1' -m hellothere -u n2 -P password
Negative scenarios
Unauthorized Topic - Fails (nothing sent to subscriber)
mosquitto_pub -t 'hello/2' -m hellothere -u n2 -P password
GDB output:
1426720139: |-- mosquitto_auth_unpwd_check(n2)
1426720139: |-- ** checking backend redis
1426720139: |-- getuser(n2) AUTHENTICATED=1 by redis
1426720139: |-- mosquitto_auth_acl_check(..., mosqpub/13391-berryp, n2, hello/2, MOSQ_ACL_WRITE)
1426720139: |-- user n2 was authenticated in back-end 0 (redis)
1426720139: |-- aclcheck(n2, hello/2, 2) AUTHORIZED=0 by redis
1426720139: |-- Cached [3E73EF89F336545CDA0B4EC82FDDCEF7E15265CA] for (mosqpub/13391-berryp,n2,2)
Unauthenticated User- Fails (nothing sent to subscriber)
$ mosquitto_pub -t 'hello/1' -m hellothere -u n2 -P wrongpassword
Connection Refused: bad user name or password.
Error: The connection was refused.
GDB Output:
1426720275: |-- mosquitto_auth_unpwd_check(n2)
1426720275: |-- ** checking backend redis
1426720276: |-- getuser(n2) AUTHENTICATED=0 by none
from mosquitto-auth-plug.
Related Issues (20)
- ACL issue with JWT backend HOT 2
- Inconsistencies between HTTP and JWT code & configuration HOT 3
- Merge be-http and be-jwt into one
- conf->hostname might be uninitialized in be_jwt_init() HOT 2
- ACL issue with %d placeholder - MySQL backend HOT 4
- Compilation Error HOT 1
- Compilation Error config.h: No such file or directory HOT 19
- problem with sizeof HOT 1
- Compile error with Mosquitto 1.5.5 and latest Auth-plug version HOT 2
- Websocket error: connection was lost (verbose output) HOT 4
- given the current vesion of Auth-plug, what version of mosquitto and libwebsockets should I install? HOT 1
- Fact that a user is superuser is not cached HOT 1
- mysql problem acl SUB/PUB HOT 1
- Cannot Load Auth plug-Error HOT 8
- mosquitto_client_id: symbol not found HOT 5
- Failed to create file named auth-plug.so
- Segmentation fault with BE_PSK and postgres backend HOT 1
- HTTP backend doesn't connect, instead rejects subscriptions HOT 1
- HTTP backend not calling api HOT 1
- Issue subscribing with wildcard in MongoDB and maybe MySQL HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mosquitto-auth-plug.