Unable to connect to Postgres DB due to the authentication type 10 is not supported

We Are Going To Discuss About Unable to connect to Postgres DB due to the authentication type 10 is not supported. So lets Start this Java Article.

Unable to connect to Postgres DB due to the authentication type 10 is not supported

Advertisements
  1. Unable to connect to Postgres DB due to the authentication type 10 is not supported

    According to the wiki, the supported JDBC driver for SCRAM-SHA-256 encryption is 42.2.0 or above.
    In my case, the driver was 41.1.1. Change it to 42.2.0 or above. That fixed it for me.
    (Maven, pom.xml):

  2. Unable to connect to Postgres DB due to the authentication type 10 is not supported

    According to the wiki, the supported JDBC driver for SCRAM-SHA-256 encryption is 42.2.0 or above.
    In my case, the driver was 41.1.1. Change it to 42.2.0 or above. That fixed it for me.
    (Maven, pom.xml):

Solution 1

Advertisements

I solved similar issue by applying below steps in PostgreSQL Version 13 :

  1. Change password_encryption to md5.

    File: C:\Program Files\PostgreSQL\13\data\postgresql.conf

    enter image description here

  2. Change scram-sha-256 to md5 in host settings.

    File: C:\Program Files\PostgreSQL\13\data\pg_hba.conf.

    host all all 0.0.0.0/0 md5

    enter image description here

  3. Change Password ( this restore password in md5 format).

    Example: ALTER ROLE postgres WITH PASSWORD 'root';

  4. Make sure you set listen_addresses = '*' if you are working non production
    environment.

    File : C:\Program Files\PostgreSQL\13\data\postgresql.conf

Original Author Of This Content

Solution 2

Advertisements

Get your pg_hba.conf File in the Directory
C:\Program Files\PostgreSQL\13\data\pg_hba.conf

And Simply Change scram-sha-256 under Column Method to trust.

enter image description here

It worked For me!

Original Author Of This Content

Solution 3

Advertisements

According to the wiki, the supported JDBC driver for SCRAM-SHA-256 encryption is 42.2.0 or above.
In my case, the driver was 41.1.1. Change it to 42.2.0 or above. That fixed it for me.

(Maven, pom.xml):

<dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <version>42.2.0</version>
</dependency>

Original Author Of This Content

Solution 4

Advertisements

By setting password_encryption to scram-sha-256 (which is the default value in v13) you also get scram-sha-256 authentication, even if you have md5 in pg_hba.conf.

Now you are using an old JDBC driver version on the client side that does not support that authentication method, even though PostgreSQL introduced it in v10, three years ago.

You should upgrade your JDBC driver. An alternative would be to set password_encryption back to md5, but then you’ll have to reset all passwords and live with lower security.

Original Author Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

Siddharth

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment