@@ -947,15 +947,24 @@ omicron bryanh guest1
947
947
</para>
948
948
949
949
<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</>.
959
968
</para>
960
969
961
970
<para>
@@ -997,10 +1006,13 @@ omicron bryanh guest1
997
1006
<term><literal>include_realm</literal></term>
998
1007
<listitem>
999
1008
<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</>.
1004
1016
</para>
1005
1017
</listitem>
1006
1018
</varlistentry>
@@ -1010,12 +1022,15 @@ omicron bryanh guest1
1010
1022
<listitem>
1011
1023
<para>
1012
1024
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.
1019
1034
</para>
1020
1035
</listitem>
1021
1036
</varlistentry>
@@ -1070,10 +1085,13 @@ omicron bryanh guest1
1070
1085
<term><literal>include_realm</literal></term>
1071
1086
<listitem>
1072
1087
<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</>.
1077
1095
</para>
1078
1096
</listitem>
1079
1097
</varlistentry>
@@ -1083,7 +1101,15 @@ omicron bryanh guest1
1083
1101
<listitem>
1084
1102
<para>
1085
1103
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.
1087
1113
</para>
1088
1114
</listitem>
1089
1115
</varlistentry>
0 commit comments