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?

已提问 1 年前384 查看次数
2 回答
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
专家
已回答 1 年前
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
专家
Ziad
已回答 1 年前
  • sha-256 doesn't appear to be supported in Redshift when connecting with libpq.

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则