Passwordless login only works with the native client
See original GitHub issueBelow shows me trying to connect to the “tngfooty” database using a unix domain socket without specifying a password. If I use the native client, it works. With the javascript client, authenticaton fails.
pg = require 'pg'
# If this line is omitted, password authentication will fail.
# pg = pg.native
pg.connect 'postgresql:///tngfooty', (err, client) ->
console.log err
client.query 'select now() as when', (err, result) ->
console.log 'Row count: %d', result.rows.length
console.log 'When: %s', result.rows[0].when
(sorry for the coffeescript)
Issue Analytics
- State:
- Created 11 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Passwordless login only works using directly invoked sshd on ...
This is an SELinux problem, caused by your home directory being in a weird location. The thing you did to disable it, didn't....
Read more >Passwordless SSH only works when I'm already logged in on ...
Solution is to move the AuthorizedKeysFile to some other place, that will be accessible or us global store for keys ( /etc/security/ ...
Read more >How to Set Up SSH Passwordless Login (Step-by-Step Tutorial)
Step 1: Generate a key pair. Step 2: Create SSH directory on server. Step 3: Upload public key to remote server. Step 4:...
Read more >Passwordless Connections - Auth0
When a user authenticates via passwordless, the user is attached to the connection using Auth0 as the Identity Provider (IdP). Since you can't...
Read more >Enable passwordless sign-in with Microsoft Authenticator
When a user has enabled any passwordless credential, the Azure AD login process stops using the login_hint. Therefore the process no longer accelerates...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was getting this because my dev machine defaulted to trust for local TCP connections, but my test/deploy machine defaulted to md5. To fix:
sudo vim /etc/postgresql/9.1/main/pg_hba.conf
and change theline to end with “trust” instead of “md5”. Then restart your postgres.
It’s not strange because the javascript bindings sends a username and password even if you dont want them to. In the above example it sends process.env.USER as the username and null as the password even though it shouldn’t do username authentication at all.