Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Feature Request: SASL OAUTHBEARER support for PostgreSQL 18

Aperta
#3,687 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
javascript, postgresql

Direzione di ricerca

Non vengono nominati file, test o punti di ingresso. Inizia con i riferimenti a RFC 7628, PostgreSQL OAuth authentication, libpq OAuth client e SASL protocol, quindi esamina l’implementazione esistente di SASL e password-callback. Il lavoro è completato quando OAUTHBEARER viene negoziato correttamente, sono definiti i parametri di connessione OAuth e un bearer-token hook, e le PostgreSQL 18 OAuth connections funzionano.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

feature request

PostgreSQL 18 introduced native OAuth 2.0 authentication via the SASL OAUTHBEARER mechanism (RFC 7628). pg currently has no support for this mechanism, which prevents connections to any PostgreSQL 18 instance configured with method=oauth in pg_hba.conf.

Background

PG18 adds OAUTHBEARER as a third SASL mechanism alongside the existing SCRAM-SHA-256 and SCRAM-SHA-256-PLUS. When a client connects to an OAuth-configured server, the server advertises OAUTHBEARER in its AuthenticationSASL message. The client must then conduct a multi-step SASL exchange, either:

  • Running a full OAuth flow (e.g. Device Authorization Grant, RFC 8628) and presenting the resulting bearer token, or
  • Presenting a pre-fetched bearer token directly in the initial SASL message

Relevant PG18 docs: https://www.postgresql.org/docs/current/auth-oauth.html

Why the existing password callback isn't sufficient

The dynamic password callback added for AWS RDS token auth gets conceptually close, but isn't a workaround here. Even if a valid bearer token were returned from the callback, pg would attempt to use it in a SCRAM exchange. The server expects OAUTHBEARER SASL messages instead and will reject the connection at the protocol level.

What's needed
  • Recognition of OAUTHBEARER in the server's advertised SASL mechanism list
  • Implementation of the SASL OAUTHBEARER message exchange
  • New connection parameters for oauth_issuer and oauth_client_id (mirroring libpq)
  • A hook or callback for the caller to supply a bearer token (fetched from user's IdP)
References
Lingua principale
JavaScript
Stelle
13.2k
Fork
1.4k
Merge medio
6g 15h
PR unite (30g)
6

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di brianc/node-postgres

Tutte le issue di brianc/node-postgres

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.