How to configure auth.pgsql.password_hash for django password
- Dominant language
- Erlang
- Stars
- 36
- Forks
- 30
- PR merge metrics
- No merged PRs in 30d
Description
I want emqx to authenticate my Django user. Django uses PBKDF2 with sha356 + 150000 iterations + salt. Django has a `make_password` method to hash plain password in a secure way.
```python
>>> from django.contrib.auth.hashers import make_password
>>> make_password("hello world")
'pbkdf2_sha256$150000$YSu4ev2bmi9t$YieK5QrYzdlktW9E1EymOjY3T0RUbF8EaPoR57otsq4='
```
it is in the following format:
```
$$$
```
Check this for more info: https://docs.djangoproject.com/en/3.0/topics/auth/passwords/#how-django-stores-passwords.
I can break the string into subsequent components and store them in separate columns.
How should I configure `auth.pgsql.password_hash` in this case??
I am thinking of something the following:
```
auth.pgsql.password_hash = salt,pbkdf2,sha256,150000,32
auth.pgsql.auth_query = select password from mqtt_user where username = '%u' limit 1
```
Will it work? Is the configuration correct? How will emqx know what the salt is? Or as of now using salt with pbkdf2 is not supported? Or should I store the salt with password hash in one column only with some separator(or without separator)? Also, should the hash and salt both be base64 encoded?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.