2

I'm trying to enable windows authentication for Postgresql 9.3 (Windows x64 not in domain, UAC is disabled, my account is local admin). The one click installer set the server running under NETWORKSERVICE which I think is fine. I followed this answer but it does not work:

C:\Program Files\PostgreSQL\9.3\bin>createdb --host=localhost testdb
Password:
Password:
createdb: could not connect to database template1: fe_sendauth: no password supplied

Created Login Roles named exactly as Windows account names - still no luck. What am I doing wrong? All the manuals I found on the net either obsolete or not applicable (require AD).

UserControl
  • 135
  • 1
  • 6

2 Answers2

4

If anyone else encounters this like I did so starting from 9.5 you will need to add an optional parameter both to the ipv4 and ipv6 in order for this to work

include_realm=0

so the whole thing will look like

host all your_username 127.0.0.1/32 sspi include_realm=0
Dan Kuida
  • 141
  • 4
  • Reading about include_realm=0 in the [docs](https://www.postgresql.org/docs/current/sspi-auth.html) and it's worth noting that "it is not secure in multi-realm environments unless krb_realm is also used". – Jeremy Cook Nov 08 '21 at 20:05
1

You haven't set the auth type to sspi in pg_hba.conf for the user/host/database combo you're using.

Craig Ringer
  • 10,553
  • 9
  • 38
  • 59