Closed golmujik closed 5 years ago
Can you please reformat the issue like this one https://github.com/vernemq/vernemq/issues/1234, adding more structure and context to the question could help the team/community help you.
Thanks
Ok I will do that☺️
As @codeadict mentions, please use the issue template when opening issues. From the short snippet I can see that you have an auth entry for the client-id test-client
, but you're connecting with a client using the client-id mqttjs_0986b129
which doesn't match the entry and the client is rejected.
Hi, I got a solution that in lua script file named mongodb.lua I replaced if doc.passhash == bcrypt.hashpw(reg.password, doc.passhash) then
with if doc.passhash == reg.password then
and it started working
I am sure the password stored in mongodb is wrongly hashed so I just want a way to properly generate the hash which will work with it? please
If you did that then the password in mongodb isn't hashed. Perhaps you have an old entry in there. Try to list all entries/documents to verify. Can I please ask you to ask usage questions on the community slack channel: https://slack-invite.vernemq.com/ as this is clearly not a bug.
Yes, it is not a bug after removing the lines which check for hash I saved plain string password in database and client too.
So the only thing I think I am doing wrong is generating a wrong hash and I don't know how to generate a proper hash. So help with the step to generate proper supported hash would be appreciated. :)
I did not join slack because I have not used it yet I don't have an account either.
Hi, @larshesel I asked in slack too but I did not get the way to generate hash will work with it. Please help if you know 😞 .
answered on slack.
2019-08-02 17:40:41.777 [warning] <0.879.0>@vmq_mqtt5_fsm:check_user:857 can't authenticate client {[],<<"mqttjs_0986b129">>} from 127.0.0.1:52052 due to invalid_credentials
How can I generate the password which will work with it? in Mongo DB
My mongodb contains this
db.vmq_acl_auth.insert({ mountpoint: '', client_id: 'test-client', username: 'test-user', passhash: '$2a$12$WDzmynWSMRVzfszQkB2MsOWYQK9qGtfjVpO8iBdimTOjCK/u6CzJK', publish_acl: [ {pattern: 'a/b/c'}, {pattern: 'a/+/d'} ], subscribe_acl: [ {pattern: 'a/#'} ] })