Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Postgres configuration using windows authentication

I’m starting to use Postgres as a database in my application, and I need to configure an agent that serves as a build server as part of the build we are running unit tests.
I need to configure the agent and I’m having trouble as the agent name is different for each machine, and there is a configuration in Postgres that needs to be applied when using windows authentication in the pg_hba.conf and pg_indent.conf.

In the pg_indent.conf I need to use a system user, and I have one, but in the following syntax user@comutername:

# MAPNAME       SYSTEM-USERNAME         PG-USERNAME
MapForSSPI     user@computername        postgres

The issue is when the agent is starting (we have a dynamic pool) the name of the computer is different, and I want to avoid using the computer name, and use something like user@localhost or the equivalent in Postgres.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

How I can achieve that?

>Solution :

You can use wildcards in pg_ident.conf:

MapForSSPI     /^user@        postgres

That will match everything that starts with user@.

Pleas promise me that you will not allow your application to connect as a superuser, that is an unnecessary risk.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading