﻿# PostgreSQL rechecks allowed OAuth validator libraries during authentication

OAuth authentication now rechecks oauth_validator_libraries after policy changes; qualify the inconsistent-rule transition separately from existing session lifetime.

Author: Retrivium team
Updated: 2026-11-15
Canonical URL: https://retrivium.ai/journal/week46-ops-postgres-oauth-validator-library-recheck/
Language: en

PostgreSQL 18.7 makes changes to oauth_validator_libraries effective during OAuth authentication even when an existing oauth entry in pg_hba.conf becomes invalid under the new setting. Previously enforcement could wait until that configuration mismatch was fixed. The release repairs a policy-update boundary: changing the allowlist should not leave authentication relying on the old permission merely because a dependent rule is now inconsistent.

## Test the transition that creates the mismatch

The notes identify an existing oauth line becoming invalid after an allowlist change. A proposed qualification starts from valid authentication, changes the library setting while retaining that line and performs a new authentication attempt. Installing a fully consistent configuration from scratch bypasses the regression. Record the effective setting and the rule involved without exposing tokens or credentials. The expected result should follow the updated policy rather than the previous library permission.

## An invalid dependent rule must not preserve old permission

The old behavior made enforcement depend on first repairing a now-invalid pg_hba.conf situation. That reverses the intended authority of the library allowlist. The patch adds a recheck at authentication time. A regression test should include a permitted library control as well as the removed-library case, so a blanket authentication failure is not mistaken for correct selective enforcement. The release does not introduce a new OAuth protocol or a universal validator configuration.

## Authentication policy differs from session revocation

The entry is about rechecking during OAuth authentication. It does not say that already established database sessions are terminated when the setting changes. A qualification should open fresh connections for the policy test and track pre-existing sessions separately if that behavior matters. Treating a surviving old connection as proof of failed authentication recheck would test a different contract. Likewise, rejecting a new connection does not by itself demonstrate complete offboarding of every active session.

## Keep failure diagnostics tied to the effective policy

Operational notes should retain the version, effective library setting, relevant authentication rule and result of a fresh attempt. That makes the policy transition reviewable without publishing sensitive authentication material. The release provides a consistency repair, not a general security certification for an OAuth deployment. Validator implementation, identity mapping and authorization still need their own configuration review. A successful local recheck proves this boundary only, while broader access-control outcomes require corresponding evidence.

## Sources

- [PostgreSQL 18.7 release notes](https://www.postgresql.org/docs/release/18.7/)
- [PostgreSQL upstream change 8e54a4145](https://github.com/postgres/postgres/commit/8e54a4145)
- [PostgreSQL upstream change dcf112bd4](https://github.com/postgres/postgres/commit/dcf112bd4)

## Related reading

- [SCIM offboarding: retained sessions and queued AI work](/journal/enterprise-ai-scim-offboarding-session-boundaries/)
- [Pooled PostgreSQL retrieval: tenant context must end with the transaction](/journal/enterprise-ai-postgres-pool-tenant-context-lifetime/)
