#412 Add OAuth bearer token injection via PQsetAuthDataHook#447
#412 Add OAuth bearer token injection via PQsetAuthDataHook#4470814celsus wants to merge 1 commit intoduckdb:mainfrom
Conversation
Implements the PG18 PQsetAuthDataHook API to inject OAuth bearer tokens during OAUTHBEARER authentication. This allows connecting to OAuth-enabled PostgreSQL servers with a pre-obtained token, bypassing the device authorization flow. Token sources (checked in priority order): 1. DuckDB setting: SET pg_oauth_token = '<token>' 2. Environment variable: PGOAUTHTOKEN The hook is registered once at extension load time.
|
@staticlibs here is the Output from my console connection to my local postgres,
|
|
Hi, thanks for the PR! I am a bit confused by the session state handling in it. For example, assuming we have 2 client threads that attach two different PG databases using OAuth for both of them. Each thread sets its own |
|
@staticlibs |
Implements the PG18 PQsetAuthDataHook API to inject OAuth bearer tokens during OAUTHBEARER authentication. This allows connecting to OAuth-enabled PostgreSQL servers with a pre-obtained token, bypassing the device authorization flow.
Token sources (checked in priority order):
The hook is registered once at extension load time.
@staticlibs let me know if anything else is needed here?