Sample Header Ad - 728x90

What's wrong with my user mapping in pg_ident?

1 vote
1 answer
1065 views
I have successfully setup certificate based authentication in postgresql-11. Now I want to do a user mapping: pg_ident.conf
# MAPNAME       SYSTEM-USERNAME         PG-USERNAME
mymap /^(.*)\.testnet\.com$    \1
pg_hba.conf
hostssl all all all cert map=mymap
Then I signed a certificate with CN user1.testnet.com, and it won't match the existing user:
2022-04-30 15:17:27.036 CST  LOG:  no match in usermap "mymap" for user "user1.testnet.com" authenticated as "user1.testnet.com"
2022-04-30 15:17:27.036 CST  FATAL:  certificate authentication failed for user "user1.testnet.com"
2022-04-30 15:17:27.036 CST  DETAIL:  Connection matched pg_hba.conf line 79: "hostssl all all all cert map=mymap"
What was wrong?
Asked by daisy (1338 rep)
Apr 30, 2022, 07:26 AM
Last activity: Jun 11, 2025, 11:22 AM