Building OAuth2 Validator Extension for PostgreSQL 18
summary
Demonstrates a working OAuth2 validator extension for PostgreSQL 18 that verifies tokens from IdPs like Keycloak and Okta by implementing the required C API callbacks (validator startup, shutdown, validate_token) and integrating the extension via postgresql.conf and pg_hba.conf. Uses libcurl and OpenSSL for network and crypto, handles both online introspection and offline JWT validation, implements JWKS caching and key rotation, enforces audience and scope checks and supports delegate identity mapping; offline mode reduces latency but needs cache refresh logic.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 1:10Why OAuth2 matters
- 5:25Prerequisites and setup
- 9:21Validator module need
- 13:13Validation strategies
- 17:56Offline validation deep dive
- 24:00Security best practices
- 25:23Implementation tips
- 27:00Q&A and references
related talks
40mPoastgreSQL Auditing, Authentication, and Security
27mEvolving OpenID Connect and Observability in Keycloak
48mAdvanced Authentication and Encrypted Connections
47mWhat does it take to onboard an extension?
49mUnderstanding OAuth 2.0 & OIDC
22mFrom trust to Tokens: A Short History of PostgreSQL Authentication
28mOAuth 2.0 and OIDC
01h 02mOAuth in 2021 – What’s up?
