Skip to content

scram-sha-256 password authentication fails #2661

Description

@nguiard

Trying to connect with a scram-sha-256 password fails (error: password authentication failed for user "<user>"), while md5 works.

Environmnent:

  • Debian 11
  • Node 17
  • pg 8.7.1
  • PostgreSQL 13 or 14 (tested with both, fails with both)

Steps to reproduce:

  • configure pg_hba to use scram-sha-256 authentication method
  • reload/restart postgresql cluster
  • with psql:
    • create user someuser password 'secret';
    • create database somedb owner someuser;
  • try to connect to the database using psql: psql postgres://someuser:secret@localhost:5432/somedb
    • works
  • try to connect to the database using node-postgres
    • fails, with error: password authentication failed for user "someuser"
  • optionally, drop the db and user, then redo the same steps but with postgresql configured to use md5 instead, and verify that connecting works both for psql and node-postgres

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions