> For the complete documentation index, see [llms.txt](https://docs.postgresql.tw/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.postgresql.tw/13/server-administration/client-authentication/authentication-methods.md).

# 20.3. Authentication Methods

PostgreSQL provides various methods for authenticating users:

* [Trust authentication](https://www.postgresql.org/docs/13/auth-trust.html), which simply trusts that users are who they say they are.
* [Password authentication](https://www.postgresql.org/docs/13/auth-password.html), which requires that users send a password.
* [GSSAPI authentication](https://www.postgresql.org/docs/13/gssapi-auth.html), 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](https://www.postgresql.org/docs/13/sspi-auth.html), which uses a Windows-specific protocol similar to GSSAPI.
* [Ident authentication](https://www.postgresql.org/docs/13/auth-ident.html), 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](https://www.postgresql.org/docs/13/auth-peer.html), 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](https://www.postgresql.org/docs/13/auth-ldap.html), which relies on an LDAP authentication server.
* [RADIUS authentication](https://www.postgresql.org/docs/13/auth-radius.html), which relies on a RADIUS authentication server.
* [Certificate authentication](https://www.postgresql.org/docs/13/auth-cert.html), which requires an SSL connection and authenticates users by checking the SSL certificate they send.
* [PAM authentication](https://www.postgresql.org/docs/13/auth-pam.html), which relies on a PAM (Pluggable Authentication Modules) library.
* [BSD authentication](https://www.postgresql.org/docs/13/auth-bsd.html), 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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.postgresql.tw/13/server-administration/client-authentication/authentication-methods.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
