@@ -947,15 +947,24 @@ omicron bryanh guest1
947947 </para>
948948
949949 <para>
950- Client principals must have their <productname>PostgreSQL</> database user
951- name as their first component, for example
952- <literal>pgusername@realm</>. Alternatively, you can use a user name
953- mapping to map from the first component of the principal name to the
954- database user name. By default, the realm of the client is
955- not checked by <productname>PostgreSQL</>. If you have cross-realm
956- authentication enabled and need to verify the realm, use the
957- <literal>krb_realm</> parameter, or enable <literal>include_realm</>
958- and use user name mapping to check the realm.
950+ Client principals can be mapped to different <productname>PostgreSQL</>
951+ database user names with <filename>pg_ident.conf</>. For example,
952+ <literal>pgusername@realm</> could be mapped to just <literal>pgusername</>.
953+ Alternatively, you can use the full <literal>username@realm</> principal as
954+ the role name in <productname>PostgreSQL</> without any mapping.
955+ </para>
956+
957+ <para>
958+ <productname>PostgreSQL</> also supports a parameter to strip the realm from
959+ the principal. This method is supported for backwards compatibility and is
960+ strongly discouraged as it is then impossible to distinguish different users
961+ with the same username but coming from different realms. To enable this,
962+ set <literal>include_realm</> to 0. For simple single-realm
963+ installations, <literal>include_realm</> combined with the
964+ <literal>krb_realm</> parameter (which checks that the realm provided
965+ matches exactly what is in the krb_realm parameter) would be a secure but
966+ less capable option compared to specifying an explicit mapping in
967+ <filename>pg_ident.conf</>.
959968 </para>
960969
961970 <para>
@@ -997,10 +1006,13 @@ omicron bryanh guest1
9971006 <term><literal>include_realm</literal></term>
9981007 <listitem>
9991008 <para>
1000- If set to 1, the realm name from the authenticated user
1001- principal is included in the system user name that's passed through
1002- user name mapping (<xref linkend="auth-username-maps">). This is
1003- useful for handling users from multiple realms.
1009+ If set to 0, the realm name from the authenticated user principal is
1010+ stripped off before being passed through the user name mapping
1011+ (<xref linkend="auth-username-maps">). This is discouraged and is
1012+ primairly available for backwards compatibility as it is not secure
1013+ in multi-realm environments unless krb_realm is also used. Users
1014+ are recommended to leave include_realm set to the default (1) and to
1015+ provide an explicit mapping in <filename>pg_ident.conf</>.
10041016 </para>
10051017 </listitem>
10061018 </varlistentry>
@@ -1010,12 +1022,15 @@ omicron bryanh guest1
10101022 <listitem>
10111023 <para>
10121024 Allows for mapping between system and database user names. See
1013- <xref linkend="auth-username-maps"> for details. For a Kerberos
1014- principal <literal>username/hostbased@EXAMPLE.COM</literal>, the
1015- user name used for mapping is <literal>username/hostbased</literal>
1016- if <literal>include_realm</literal> is disabled, and
1017- <literal>username/hostbased@EXAMPLE.COM</literal> if
1018- <literal>include_realm</literal> is enabled.
1025+ <xref linkend="auth-username-maps"> for details. For a GSSAPI/Kerberos
1026+ principal, such as <literal>username@EXAMPLE.COM</literal> (or, less
1027+ commonly, <literal>username/hostbased@EXAMPLE.COM</literal>), the
1028+ user name used for mapping is
1029+ <literal>username@EXAMPLE.COM</literal> (or
1030+ <literal>username/hostbased@EXAMPLE.COM</literal>, respectfully),
1031+ unless <literal>include_realm</literal> has been set to 0, in which case
1032+ <literal>username</literal> (or <literal>username/hostbased</literal>)
1033+ is what is seen as the system username when mapping.
10191034 </para>
10201035 </listitem>
10211036 </varlistentry>
@@ -1070,10 +1085,13 @@ omicron bryanh guest1
10701085 <term><literal>include_realm</literal></term>
10711086 <listitem>
10721087 <para>
1073- If set to 1, the realm name from the authenticated user
1074- principal is included in the system user name that's passed through
1075- user name mapping (<xref linkend="auth-username-maps">). This is
1076- useful for handling users from multiple realms.
1088+ If set to 0, the realm name from the authenticated user principal is
1089+ stripped off before being passed through the user name mapping
1090+ (<xref linkend="auth-username-maps">). This is discouraged and is
1091+ primairly available for backwards compatibility as it is not secure
1092+ in multi-realm environments unless krb_realm is also used. Users
1093+ are recommended to leave include_realm set to the default (1) and to
1094+ provide an explicit mapping in <filename>pg_ident.conf</>.
10771095 </para>
10781096 </listitem>
10791097 </varlistentry>
@@ -1083,7 +1101,15 @@ omicron bryanh guest1
10831101 <listitem>
10841102 <para>
10851103 Allows for mapping between system and database user names. See
1086- <xref linkend="auth-username-maps"> for details.
1104+ <xref linkend="auth-username-maps"> for details. For a SSPI/Kerberos
1105+ principal, such as <literal>username@EXAMPLE.COM</literal> (or, less
1106+ commonly, <literal>username/hostbased@EXAMPLE.COM</literal>), the
1107+ user name used for mapping is
1108+ <literal>username@EXAMPLE.COM</literal> (or
1109+ <literal>username/hostbased@EXAMPLE.COM</literal>, respectfully),
1110+ unless <literal>include_realm</literal> has been set to 0, in which case
1111+ <literal>username</literal> (or <literal>username/hostbased</literal>)
1112+ is what is seen as the system username when mapping.
10871113 </para>
10881114 </listitem>
10891115 </varlistentry>
0 commit comments