On windows 2016 in AD setup when I try to use SSPI with postgresql 11 and following settings :
pg_hba.conf:
host all all 127.0.0.1/32 sspi map=newmap #IP4
pg_ident.conf:
newmap SrvSupportPsgr srvsupportpsgr
log:
Log: no match in usermap "newmap" for user "SrvSupportPsgr" authenticated as "SrvSupportPsgr@domainname"
FATAL: SSPI authentication failed for user "SrvSupportPsgr"
this account has superuser on postgres and local admin + domain user on AD. I have tried putting usernames in double quotes as well. thanks
1 Answer 1
If you are authenticated as "SrvSupportPsgr@domainname", then that is what needs to be in the 2nd column of pg_ident.conf; including the "@domainname" part. (Or it could be a regexp which matches to that)
Also, pg_ident.conf is case sensitive. In the third column, "SrvSupportPsgr" is not the same thing as "srvsupportpsgr".
-
thanks for the answer. I tried with domainname part added but didn't work. DB username is all lower case.CAM– CAM2019年07月22日 08:15:42 +00:00Commented Jul 22, 2019 at 8:15
-
The error message is showing the attempted username as mixed case.jjanes– jjanes2019年07月22日 10:59:14 +00:00Commented Jul 22, 2019 at 10:59
-
but isn't it suppose to map it to lowercase provided. thanksCAM– CAM2019年07月22日 12:41:01 +00:00Commented Jul 22, 2019 at 12:41
-
Mapping to lower case for unquoted SQL identifiers is done inside the database. You are not inside the database until after the connection is established, you are outside of it. (And if it did map to lower case, I think the error message would have reflected that.)jjanes– jjanes2019年07月22日 20:21:15 +00:00Commented Jul 22, 2019 at 20:21