I’m configuring the authentication using PostgreSQL. I’ve configured the emqx query that you can see in the emqx_query.jpg image and my PostgreSQL table is the one you can see in the postgre_table.jpg image.
So my problem is that when I try to connect with a client it only connects when I use a user that has the password “public” (The users with the password rounded with red in the image), when I use a user with another passwork it does not connect.
Can you please help me find why is that happening. I have no idea what could provoke this, it doen not make any sense.
How did you create the other users? Do they use the same salt?
I have created all users using the same comand:
INSERT INTO tabla_usuarios (username, password_hash, salt, nivelacceso)
VALUES (‘mbddis’, ‘28F0116EF42BF718324946F13D787A1D41274A08335D52EE833D5B577F02A32A’, NULL, true);
In all users the salt is Null.
To create the password hash I’ve used this website: SHA-256 - Hash SHA256 Contraseña - Decodificar, Codificar Online
It’s so strange that the only password that accepts is public, that is the one that emqx has for default for accessing the dashboard.
Can you dump the schema of your database? Also can you please show how you configured authentication chain? Perhaps there is some other backend in the chain that shadows Postgres.
Authentication | EMQX Documentation (EMQX v5 instruction).
Here you have my database schema (see schema.jpg).
In authentication in EMQX I only have a PostgreSQL Backend(see authentication.jpg).
And here you can see my PostgreSQL configuration (see postgre.jpg).