]> begriffs open source - ai-pg/blob - full-docs/src/sgml/html/sspi-auth.html
PG 18 docs from https://ftp.postgresql.org/pub/source/v18.0/postgresql-18.0-docs...
[ai-pg] / full-docs / src / sgml / html / sspi-auth.html
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>20.7. SSPI Authentication</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="gssapi-auth.html" title="20.6. GSSAPI Authentication" /><link rel="next" href="auth-ident.html" title="20.8. Ident Authentication" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">20.7. SSPI Authentication</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="gssapi-auth.html" title="20.6. GSSAPI Authentication">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="client-authentication.html" title="Chapter 20. Client Authentication">Up</a></td><th width="60%" align="center">Chapter 20. Client Authentication</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="auth-ident.html" title="20.8. Ident Authentication">Next</a></td></tr></table><hr /></div><div class="sect1" id="SSPI-AUTH"><div class="titlepage"><div><div><h2 class="title" style="clear: both">20.7. SSPI Authentication <a href="#SSPI-AUTH" class="id_link">#</a></h2></div></div></div><a id="id-1.6.7.14.2" class="indexterm"></a><p>
3     <span class="productname">SSPI</span> is a <span class="productname">Windows</span>
4     technology for secure authentication with single sign-on.
5     <span class="productname">PostgreSQL</span> will use SSPI in
6     <code class="literal">negotiate</code> mode, which will use
7     <span class="productname">Kerberos</span> when possible and automatically
8     fall back to <span class="productname">NTLM</span> in other cases.
9     <span class="productname">SSPI</span> and <span class="productname">GSSAPI</span>
10     interoperate as clients and servers, e.g., an
11     <span class="productname">SSPI</span> client can authenticate to an
12     <span class="productname">GSSAPI</span> server.  It is recommended to use
13     <span class="productname">SSPI</span> on Windows clients and servers and
14     <span class="productname">GSSAPI</span> on non-Windows platforms.
15    </p><p>
16     When using <span class="productname">Kerberos</span> authentication,
17     <span class="productname">SSPI</span> works the same way
18     <span class="productname">GSSAPI</span> does; see <a class="xref" href="gssapi-auth.html" title="20.6. GSSAPI Authentication">Section 20.6</a>
19     for details.
20    </p><p>
21     The following configuration options are supported for <span class="productname">SSPI</span>:
22     </p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="literal">include_realm</code></span></dt><dd><p>
23         If set to 0, the realm name from the authenticated user principal is
24         stripped off before being passed through the user name mapping
25         (<a class="xref" href="auth-username-maps.html" title="20.2. User Name Maps">Section 20.2</a>). This is discouraged and is
26         primarily available for backwards compatibility, as it is not secure
27         in multi-realm environments unless <code class="literal">krb_realm</code> is
28         also used.  It is recommended to
29         leave <code class="literal">include_realm</code> set to the default (1) and to
30         provide an explicit mapping in <code class="filename">pg_ident.conf</code> to convert
31         principal names to <span class="productname">PostgreSQL</span> user names.
32        </p></dd><dt><span class="term"><code class="literal">compat_realm</code></span></dt><dd><p>
33         If set to 1, the domain's SAM-compatible name (also known as the
34         NetBIOS name) is used for the <code class="literal">include_realm</code>
35         option. This is the default. If set to 0, the true realm name from
36         the Kerberos user principal name is used.
37        </p><p>
38         Do not disable this option unless your server runs under a domain
39         account (this includes virtual service accounts on a domain member
40         system) and all clients authenticating through SSPI are also using
41         domain accounts, or authentication will fail.
42        </p></dd><dt><span class="term"><code class="literal">upn_username</code></span></dt><dd><p>
43         If this option is enabled along with <code class="literal">compat_realm</code>,
44         the user name from the Kerberos UPN is used for authentication. If
45         it is disabled (the default), the SAM-compatible user name is used.
46         By default, these two names are identical for new user accounts.
47        </p><p>
48         Note that <span class="application">libpq</span> uses the SAM-compatible name if no
49         explicit user name is specified. If you use
50         <span class="application">libpq</span> or a driver based on it, you should
51         leave this option disabled or explicitly specify user name in the
52         connection string.
53        </p></dd><dt><span class="term"><code class="literal">map</code></span></dt><dd><p>
54         Allows for mapping between system and database user names. See
55         <a class="xref" href="auth-username-maps.html" title="20.2. User Name Maps">Section 20.2</a> for details.  For an SSPI/Kerberos
56         principal, such as <code class="literal">username@EXAMPLE.COM</code> (or, less
57         commonly, <code class="literal">username/hostbased@EXAMPLE.COM</code>), the
58         user name used for mapping is
59         <code class="literal">username@EXAMPLE.COM</code> (or
60         <code class="literal">username/hostbased@EXAMPLE.COM</code>, respectively),
61         unless <code class="literal">include_realm</code> has been set to 0, in which case
62         <code class="literal">username</code> (or <code class="literal">username/hostbased</code>)
63         is what is seen as the system user name when mapping.
64        </p></dd><dt><span class="term"><code class="literal">krb_realm</code></span></dt><dd><p>
65         Sets the realm to match user principal names against. If this parameter
66         is set, only users of that realm will be accepted.  If it is not set,
67         users of any realm can connect, subject to whatever user name mapping
68         is done.
69        </p></dd></dl></div><p>
70    </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="gssapi-auth.html" title="20.6. GSSAPI Authentication">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="client-authentication.html" title="Chapter 20. Client Authentication">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="auth-ident.html" title="20.8. Ident Authentication">Next</a></td></tr><tr><td width="40%" align="left" valign="top">20.6. GSSAPI Authentication </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="40%" align="right" valign="top"> 20.8. Ident Authentication</td></tr></table></div></body></html>