Closed jcummings2 closed 1 year ago
But you have user1@localhost
registered with password Pass
? I just tested this with recent version and it just worked as long i provided correct user/pass
But you have
user1@localhost
registered with passwordPass
? I just tested this with recent version and it just worked as long i provided correct user/pass
Yes, I added the user with:
ejabberdctl register user1 localhost Pass
as instructed in the MQTT guide.
Could you try set ejabberd logging to debug level and see what it logs when you try that again? (You can do it by calling ejabberdctl set_loglevel debug
, you can switch it back with ejabberdctl set_loglevel info
)
Could you try set ejabberd logging to debug level and see what it logs when you try that again? (You can do it by calling
ejabberdctl set_loglevel debug
, you can switch it back withejabberdctl set_loglevel info
)
Certainly, the relevant lines in ejabberd.log
are:
2023-02-10 06:10:11.619060-06:00 [info] <0.415.0>@ejabberd_listener:accept/7:273 (<0.1587.0>) Accepted connection [::1]:35284 -> [::1]:1883
2023-02-10 06:10:11.620399-06:00 [debug] <0.1587.0>@mod_mqtt_session:handle_info/2:240 Got MQTT packet:
#connect{proto_level = 4,will = undefined,clean_start = true,keep_alive = 60,
client_id = <<>>,username = <<"user1@localhost">>,
password = <<"Pass">>,will_properties = #{},properties = #{}}
2023-02-10 06:10:11.622841-06:00 [warning] <0.1587.0>@mod_mqtt_session:log_disconnection/2:1362 Rejected MQTT connection from ::1: Authentication failed: Not authorized
2023-02-10 06:10:11.623688-06:00 [debug] <0.1587.0>@mod_mqtt_session:do_send/2:871 Send MQTT packet:
#connack{session_present = false,code = 'not-authorized',properties = #{}}
Could you also execute ejabberdctl check_password user1 localhost Pass; echo $?
Could you also execute
ejabberdctl check_password user1 localhost Pass; echo $?
Yes. I also ran it with the wrong password to give further evidence the correct password is being used:
# ejabberdctl check_password user1 localhost Pass; echo $?
0
# ejabberdctl check_password user1 localhost Pass2; echo $?
Error: false
1
Strange stuff, one more thing could you start debug console (with ejabberdctl debug
) and type ejabberd_auth:check_password_with_authmodule(<<"user1">>, <<>>, <<"localhost">>, <<"Pass">>).
in that and see what it returns? You can close console after that with ctrl+c twice.
Strange stuff, one more thing could you start debug console (with
ejabberdctl debug
) and typeejabberd_auth:check_password_with_authmodule(<<"user1">>, <<>>, <<"localhost">>, <<"Pass">>).
in that and see what it returns? You can close console after that with ctrl+c twice.
Yes
Erlang/OTP 23 [erts-11.1.8] [source] [smp:4:4] [ds:4:4:10] [async-threads:1]
Eshell V11.1.8 (abort with ^G)
(ejabberd@localhost)1> ejabberd_auth:check_password_with_authmodule(<<"user1">>, <<>>, <<"localhost">>, <<"Pass">>).
{true,ejabberd_auth_mnesia}
I really don't know what's happening here then, this is pretty much code that mqtt calls to authenticate user. I test that with a bit newer version, but i don't think there is anything in it that should affect it...
Before creating a ticket, please consider if this should fit the discussion forum better: https://github.com/processone/ejabberd/discussions
Environment
sudo apt install ejabberd
Configuration (only if needed): grep -Ev '^$|^\s*#' ejabberd.yml
Errors from error.log/crash.log
None in
error.log
butejabberd.log
has:Bug description
Following the installation instructions and the MQTT Guide, I cannot connect to the MQTT server. Calling
On the raspberry pi itself has the output:
I saw issue #3593 but no suggestion there helped. I also do not really want anonymous authentication.