Giter Site home page Giter Site logo

Comments (6)

jpmens avatar jpmens commented on June 11, 2024

Please show your mosquitto.conf (without passwords), as well as a description of the HTTP service you're using.

from mosquitto-auth-plug.

pat1 avatar pat1 commented on June 11, 2024

my mosquitto.conf:
pid_file /var/run/mosquitto.pid
persistent_client_expiration 1d
persistence true
persistence_location /var/lib/mosquitto/
log_dest stdout
log_type debug
log_type error
log_type warning
log_type notice
log_type information
connection_messages true
log_timestamp true
include_dir /etc/mosquitto/conf.d

included rmap.conf file:
auth_plugin /home/pat1/svn/mosquitto-auth-plug/trunk/auth-plug.so
auth_opt_backends http
auth_opt_http_hostname localhost
auth_opt_http_ip 127.0.0.1
auth_opt_http_port 8100
auth_opt_http_getuser_uri /auth
auth_opt_http_superuser_uri /superuser
auth_opt_http_aclcheck_uri /acl

I use for my test http-auth-be.py in example directory

the patch below solve the problem for me but I think it is not clean:

--- cache.c (revisione 125)
+++ cache.c (copia locale)
@@ -61,6 +61,9 @@
unsigned char hashdata[SHA_DIGEST_LENGTH];
int mdlen, i;

  • if (username == NULL) return;

data = malloc(strlen(clientid) + strlen(username) + strlen(topic) + 20);
sprintf(data, "%s:%s:%s:%d", clientid, username, topic, access);

from mosquitto-auth-plug.

jpmens avatar jpmens commented on June 11, 2024

Thanks for your hints, I think you're right. I have pushed a fix which will not attempt to cache null usernames. I have also pushed a fix which sets a default for anonusername (see README.md).

Could you test if this solves the issue for you?

from mosquitto-auth-plug.

pat1 avatar pat1 commented on June 11, 2024

Il giorno dom, 23/11/2014 alle 13.17 -0800, JP Mens ha scritto:

Thanks for your hints, I think you're right. I have pushed a fix which
will not attempt to cache null usernames. I have also pushed a fix
which sets a default for anonusername (see README.md).

Could you test if this solves the issue for you?

Thanks, it works !

1416778024: New connection from 192.168.1.172 on port 1883.
1416778024: New client connected from 192.168.1.172 as mosqpub/6505-asus-pat1 (c1, k60).
1416778024: Sending CONNACK to mosqpub/6505-asus-pat1 (0)
1416778024: |-- mosquitto_auth_acl_check(..., mosqpub/6505-asus-pat1, anonymous, /test, MOSQ_ACL_WRITE)
1416778024: |-- url=http://127.0.0.1:8100/superuser
1416778024: |-- user anonymous was authenticated in back-end 0 (http)
1416778024: |-- url=http://127.0.0.1:8100/acl
1416778024: |-- aclcheck(anonymous, /test, 2) AUTHORIZED=0 by http
1416778024: |-- Cached [77002C9B194B464613C22FB1521CDBC2B0EBD2BB] for (mosqpub/6505-asus-pat1,anonymous,2)
1416778024: Denied PUBLISH from mosqpub/6505-asus-pat1 (d0, q0, r0, m0, '/test', ... (4 bytes))
1416778024: Received DISCONNECT from mosqpub/6505-asus-pat1

from mosquitto-auth-plug.

jpmens avatar jpmens commented on June 11, 2024

Glad to hear that, and thanks for reporting back.

from mosquitto-auth-plug.

whidbey avatar whidbey commented on June 11, 2024

what?means when publish a message,you need to check the user again and again?
why dont' just auth functions,and when publish message no need auth any more?

from mosquitto-auth-plug.

Related Issues (20)

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.