That’s the problem OpenID Connect (OIDC) solves for pgcli users. Secure, standards-based authentication directly in your Postgres command-line workflow. No extra hacks. No storing passwords in plain text. Identity flows that match your cloud’s security model, without touching a single .pgpass file.
Why OIDC with pgcli matters
Postgres connections have traditionally lived in a world of static credentials—long-lived usernames and passwords that never change until someone remembers to rotate them. It’s a slow, brittle method, and it’s not how modern teams run secure systems.
OpenID Connect gives pgcli the same authentication power as a modern web app: single sign-on, short-lived tokens, integration with identity providers like Okta, Google, or Azure AD. That means database sessions you can trace, lock down, and expire automatically.
When pgcli is wired with OIDC, your workflow changes in three big ways:
- No more password sprawl. OIDC replaces it with secure, token-based logins.
- Consistent auth. The same identity provider for browser apps, APIs, and CLI tools.
- Better auditability. Every login has a user identity tied to corporate SSO.
How it works in practice
With the right configuration, pgcli pulls an OIDC token from your identity provider before opening a database connection. That token is validated by Postgres or a proxy layer. No static passwords, no direct credential sharing.