RefLib

Reference library for AI

Back

postgresql_16:4.6.3 Authentication Methods

PostgreSQL 16 > Server Administration > Client Authentication > Authentication Methods

PostgreSQL provides various methods for authenticating users: Trust authentication (see postgresql_16:4.6.4), which simply trusts that users are who they say they are. Password authentication (see postgresql_16:4.6.5), which requires that users send a password. GSSAPI authentication (see postgresql_16:4.6.6), which relies on a GSSAPI-compatible security library. Typically this is used to access an authentication server such as a Kerberos or Microsoft Active Directory server. SSPI authentication (see postgresql_16:4.6.7), which uses a Windows-specific protocol similar to GSSAPI. Ident authentication (see postgresql_16:4.6.8), which relies on an “Identification Protocol” (RFC 1413) service on the client's machine. (On local Unix-socket connections, this is treated as peer authentication.) Peer authentication (see postgresql_16:4.6.9), which relies on operating system facilities to identify the process at the other end of a local connection. This is not supported for remote connections. LDAP authentication (see postgresql_16:4.6.10), which relies on an LDAP authentication server. RADIUS authentication (see postgresql_16:4.6.11), which relies on a RADIUS authentication server. Certificate authentication (see postgresql_16:4.6.12), which requires an SSL connection and authenticates users by checking the SSL certificate they send. PAM authentication (see postgresql_16:4.6.13), which relies on a PAM (Pluggable Authentication Modules) library. BSD authentication (see postgresql_16:4.6.14), which relies on the BSD Authentication framework (currently available only on OpenBSD).

Peer authentication is usually recommendable for local connections, though trust authentication might be sufficient in some circumstances. Password authentication is the easiest choice for remote connections. All the other options require some kind of external security infrastructure (usually an authentication server or a certificate authority for issuing SSL certificates), or are platform-specific.

The following sections describe each of these authentication methods in more detail.

Back