I solved similar issue by applying below steps in PostgreSQL Version 13:
- Change
password_encryptiontomd5inpostgresql.conf
Windows: C:\Program Files\PostgreSQL\13\data\postgresql.conf
GNU/Linux: /etc/postgresql/13/main/postgresql.conf

- Change
scram-sha-256tomd5inpg_hba.conf
Windows: C:\Program Files\PostgreSQL\13\data\pg_hba.conf
GNU/Linux: /etc/postgresql/13/main/pg_hba.conf
host all all 0.0.0.0/0 md5

-
Change Password ( this restore password in md5 format).
Example:
ALTER ROLE postgres WITH PASSWORD 'root'; -
Make sure you set
listen_addresses="*"inpostgresql.confif you are working non production environment.