From: vlsi (@vlsi) <noreply+vlsi@github.com>
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
Subject: Re: [pgjdbc/pgjdbc] PR #4251: OAuth implementation
Date: Wed, 23 Sep 2026 06:43:34 +0000
Message-ID: <gh-pgjdbc-pgjdbc-4251-rc4079734618@github.com> (raw)
In-Reply-To: <gh-pgjdbc-pgjdbc-4251@github.com>
References: <gh-pgjdbc-pgjdbc-4251@github.com>
(on pgjdbc/src/main/java/org/postgresql/plugin/OAuthTokenProvider.java:18)
"once per connection attempt" is ambiguous. The driver creates a new instance and calls `getToken` each time a server requests OAUTHBEARER over a connection that passes the transport check. With several hosts that happens more than once per `getConnection`, and it never happens when the server picks SCRAM. The call counts toward `loginTimeout` and must return within the server's `authentication_timeout`.
Please add one more sentence: the message and cause of an exception thrown here reach the caller and the FINE `Connection error:` log record, so they must not contain the token or `clientSecret`.