Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

authentication exchange unsuccessful in postgresql 15 scram-sha-256 in scram_sha_256_auth #133

Open
xiangnanscu opened this issue Nov 29, 2022 · 0 comments

Comments

@xiangnanscu
Copy link

I use pg 15 with md5 auth, and I try to use scram_sha_256 with the following steps:
I set password_encryption = scram_sha_256 in postgresql.conf and pg_hba.conf is:

local   all             postgres                                peer

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            scram-sha-256
# IPv6 local connections:
host    all             all             ::1/128                 scram-sha-256
# Allow replication connections from localhost, by a user with the
# replication privilege.
local   replication     all                                     peer
host    replication     all             127.0.0.1/32            scram-sha-256
host    replication     all             ::1/128                 scram-sha-256

I debug in pgmoon init.lua in method scram_sha_256_auth I found the server_signature is CdDAYPZ7znlXaCStdwSMN+BoKUtbDY3cK5Pgidlg0QQ=, but the msg is SFATALVFATALC28P01Mpassword authentication failed for user "postgres"Fauth.cL326Rauth_failed. so the line local sent_server_signature = msg:match("v=([^,]+)") will be nil.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant