Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pTPss-0002VZ-UV for pgsql-general@arkaria.postgresql.org; Sat, 18 Feb 2023 16:16:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pTPsq-0001JH-Pw for pgsql-general@arkaria.postgresql.org; Sat, 18 Feb 2023 16:16:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pTPsq-0001J7-Eq for pgsql-general@lists.postgresql.org; Sat, 18 Feb 2023 16:16:20 +0000 Received: from mout-u-204.mailbox.org ([80.241.59.204]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pTPsn-0008H4-D0 for pgsql-general@postgresql.org; Sat, 18 Feb 2023 16:16:19 +0000 Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4PJv1m41Qwz9sRk; Sat, 18 Feb 2023 17:16:12 +0100 (CET) Date: Sat, 18 Feb 2023 17:16:12 +0100 (CET) From: Erik Wienhold To: Tomas Pospisek , pgsql-general@postgresql.org Message-ID: <1036920458.361352.1676736972050@office.mailbox.org> In-Reply-To: <08b836a7-272a-2309-da45-ac691fccacb8@sourcepole.ch> References: <08b836a7-272a-2309-da45-ac691fccacb8@sourcepole.ch> Subject: Re: can't get psql authentication against Active Directory working MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 18/02/2023 15:02 CET Tomas Pospisek wrote: > > so I'm trying to authenticate psql (on Windows) -> postgres (on Linux) > via Active Directory. > > psql (Linux) -> postgres (Linux) with authentication against Active > Directory does work. > > However the same with psql.exe on Windows does not. I get: > > D:\>C:\OSGeo4W\bin\psql.exe service=the_db > psql: error: connection to server at "dbserver.example.lan > (192.168.4.104), port 5432 failed: could not initiate GSSAPI > security context: No credentials were supplied, or the credentials > were unavailable or inaccessible: Internal credentials cache error > > psql.exe from the OSGeo4W QGIS Installer *does* include GSS support. (I > have tried with a different psql.exe without GSS support and it would > tell me that it does not support GSS). > > The .pg_service.conf file in the users $HOME directory looks like this: > > [the_db] > host=dbserver.example.lan > port=5432 > user=user@EXAMPLE.LAN > gssencmode=require > > This same pg_service.conf does work for psql (Linux). On Windows the service file is not read from $home/.pg_service.conf but $env:appdata/postgresql/.pg_service.conf (or %appdata%/postgresql/.pg_service.conf when using cmd.exe.) -- Erik