Comments (6)
@win5923 try to use ${username}
instead of $1
.
from emqx.
@win5923 try to use
${username}
instead of$1
.
Hi @id, I transitioned from no match
to Deny
status, and there are no error messages in the EMQX logs. Currently, I suspect that the encoding methods may differ, as my mosquitto-auth is using UTF-8. Do you have any ideas?
from emqx.
Hi @win5923
Might be due to password hash parameter or salt mismatch.
Maybe try to test with a different hash algorithm to verify ?
btw. the field is better to be named password_hash
instead of password
(both works, but password
is considered deprecated).
from emqx.
Hi @zmstone, I try to use password_hash
but got error <<"column \"password_hash\" does not exist">>
:
2024-04-10T01:58:10.384330+00:00 [error] msg: PostgreSQL parse failed, mfa: emqx_connector_pgsql:prepare_sql_to_conn/3, line: 506, error: {error,error,<<"42703">>,undefined_column,<<"column \"password_hash\" does not exist">>,[{file,<<"parse_relation.c">>},{line,<<"3718">>},{position,<<"8">>},{routine,<<"errorMissingColumn">>},{severity,<<"ERROR">>}]}, name: <<"emqx_authn_pgsql:130">>, prepare_sql: <<"SELECT password_hash FROM account where name = $1 LIMIT 1">>
2024-04-10T01:58:10.384557+00:00 [error] msg: <<"PostgreSQL init prepare statement failed">>, mfa: emqx_connector_pgsql:init_prepare/1, line: 458, error: {error,{error,error,<<"42703">>,undefined_column,<<"column \"password_hash\" does not exist">>,[{file,<<"parse_relation.c">>},{line,<<"3718">>},{position,<<"8">>},{routine,<<"errorMissingColumn">>},{severity,<<"ERROR">>}]}}
2024-04-10T01:58:10.391319+00:00 [error] msg: PostgreSQL parse failed, mfa: emqx_connector_pgsql:prepare_sql_to_conn/3, line: 506, error: {error,error,<<"42703">>,undefined_column,<<"column \"password_hash\" does not exist">>,[{file,<<"parse_relation.c">>},{line,<<"3718">>},{position,<<"8">>},{routine,<<"errorMissingColumn">>},{severity,<<"ERROR">>}]}, name: <<"emqx_authn_pgsql:130">>, prepare_sql: <<"SELECT password_hash FROM account where name = $1 LIMIT 1">>
2024-04-10T01:58:10.391516+00:00 [warning] msg: alarm_is_activated, mfa: emqx_alarm:do_actions/3, line: 418, message: <<"resource down: Unknown reason">>, name: <<"emqx_authn_pgsql:130">>
I have tried different Password Hash
methods, but the situation remains the same. The correct username and password are still being denied.
I'm not creating a new table; instead, I intend to use the table previously utilized by Mosquitto auth.
from emqx.
I understand that your database has a column named password
but not password_hash
.
What I meant as a "btw", was that EMQX can handle password
ok, but it's an alias, the formal query result should return passord_hash
.
This is likely not related to the issue, but if you do want to match EMQX's formal query result, you can use
SELECT password AS password_hash ...
from emqx.
If you share an EXAMPLE password with us, we might be able to help you compare the hash value.
It would require:
- plaintext password sent by the client
- hash stored in postgres
- although the hash algorithm and parameters can be observed from the screenshot above, it would be nice if you can share how the password is hashed before stored in postgres
- the salt for the password hash (if any)
from emqx.
Related Issues (20)
- Rest API, fields param not work HOT 3
- [error] msg: unrecoverable_error, mfa: emqx_resource_buffer_worker:handle_query_result_pure HOT 2
- Error:Mysql Connector Test Connectivity Error HOT 5
- When EMQX updates the load balancer, it resets the Connection Idle Timeout to the default value. HOT 2
- connection congested: HOT 2
- Then enter in "Retained Messages" got 500 Internal Error HOT 5
- peer_cert_as_username when using proxy protocol v2 HOT 1
- Unable to force-leave stale nodes HOT 12
- Enhanced Authentication Failed with Reason Code 135 (Not Authorized). HOT 9
- Configuration fails to take effect about TCP Keep Alive behavior HOT 6
- Grafana dashboard should use $__rate_interval HOT 3
- Customizable HTTP Server Actions (Sink) Retry Policies HOT 2
- Can not view retained messages in admin dashboard after updating to 5.6.0 from 5.5.1 HOT 7
- 使用 MongoDB4.0 进行密码认证,无法成功接入数据源。 HOT 6
- Can't add users on touch screen device HOT 7
- Action output to external HTTP server - authorization header issue HOT 2
- The client disconnects after publish message whose topic starts with '$' HOT 2
- Not getting Emqx dashboard HOT 1
- EMQX Clustering - Message Replication HOT 4
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 emqx.