Redshift error: authentication method 13 not supported appears when trying to authenticate using libpq with a user with sha256 hashed password

0

I have successfully created a user in Redshift with sha256 hashed password. When trying to authenticate through my app which is using libpq's PQconnectdb to make a new connection to Redshift I experience "authentication method 13 not supported". The same code/workflow works fine when using a user with md5.

Also, I have verified that the problem is not related to the user or Redshift configuration by establishing DB connection through ODBC and JDBC drivers (that support sha256) with the same user. Libpq(s) that I used for testing(s) are from PostgreSQL 14 and 15.

Can you please tell me if I am doing something wrong or confirm that libpq does not support Redshift sha256 hashed passwords?

asked a year ago362 views
2 Answers
1

I created a user with sha256:

create user admin1 password 'sha256|Mypassword1';

I tried with psql version 9.2.24 to connect as admin1 and it failed with:

psql: authentication method 13 not supported

9.2.24 is older and before sha-256 was added. I believe sha-256 was added in version 11. https://www.postgresql.org/docs/current/auth-password.html

I then tried with psql version 14.1 and got the same error message:

failed: authentication method 13 not supported

I then tried rsql which uses ODBC instead of libpq and it connects just fine.

Password for user admin1: 
DSN-less Connected
DBMS Name: Amazon Redshift
Driver Name: Amazon Redshift ODBC Driver
Driver Version: 1.4.52.1000
Rsql Version: 1.0.f3e0dc68
Redshift Version: 1.0.44903
Type "help" for help.

This must mean the implementation of sha-256 in Redshift is different from PostgreSQL. Redshift is a fork of PostgreSQL 8.0 and I don't know if we have done any updates to libpq. I also believe the guidance is to use ODBC or JDBC to connect.

This was asked before too: https://www.repost.aws/questions/QUGYGra6yiQrOxXat9-tLcsg/redshift-error-authentication-method-13-not-supported-when-creating-a-user-with-sha-256-hashed-password

profile pictureAWS
EXPERT
answered a year ago
0

Hi,

The two methods that are supported by the Libpq library are md5 and scram-sha256. You can find more details on the following links:

https://www.postgresql.org/docs/current/libpq-misc.html

https://www.postgresql.org/docs/current/auth-password.html

Thanks,

AWS
EXPERT
Ziad
answered a year ago
  • sha-256 doesn't appear to be supported in Redshift when connecting with libpq.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions