2 Chapter 20. Client Authentication
6 20.1. The pg_hba.conf File
8 20.3. Authentication Methods
9 20.4. Trust Authentication
10 20.5. Password Authentication
11 20.6. GSSAPI Authentication
12 20.7. SSPI Authentication
13 20.8. Ident Authentication
14 20.9. Peer Authentication
15 20.10. LDAP Authentication
16 20.11. RADIUS Authentication
17 20.12. Certificate Authentication
18 20.13. PAM Authentication
19 20.14. BSD Authentication
20 20.15. OAuth Authorization/Authentication
21 20.16. Authentication Problems
23 When a client application connects to the database server, it specifies
24 which PostgreSQL database user name it wants to connect as, much the
25 same way one logs into a Unix computer as a particular user. Within the
26 SQL environment the active database user name determines access
27 privileges to database objects — see Chapter 21 for more information.
28 Therefore, it is essential to restrict which database users can
33 As explained in Chapter 21, PostgreSQL actually does privilege
34 management in terms of “roles”. In this chapter, we consistently use
35 database user to mean “role with the LOGIN privilege”.
37 Authentication is the process by which the database server establishes
38 the identity of the client, and by extension determines whether the
39 client application (or the user who runs the client application) is
40 permitted to connect with the database user name that was requested.
42 PostgreSQL offers a number of different client authentication methods.
43 The method used to authenticate a particular client connection can be
44 selected on the basis of (client) host address, database, and user.
46 PostgreSQL database user names are logically separate from user names
47 of the operating system in which the server runs. If all the users of a
48 particular server also have accounts on the server's machine, it makes
49 sense to assign database user names that match their operating system
50 user names. However, a server that accepts remote connections might
51 have many database users who have no local operating system account,
52 and in such cases there need be no connection between database user
53 names and OS user names.