D
D
Dred Wolf2021-03-10 18:08:22
PostgreSQL
Dred Wolf, 2021-03-10 18:08:22

How to set up PostgreSQL user authentication?

I have an application that needs to connect to a PostgreSQL server. I am not strong in databases, but as I understand it, it would be correct to create a separate user for the application and issue rights to a specific database with which it will then work.
1) User was created (CREATE USER app WITH PASSWORD '12345')
2) Database + table were created (CREATE BASE app_base OWNER = app)
Using IntellijIDEA I connect to the server in the DataBase tab where you need to enter Host(localhost), URL and the most interesting User and Password. So it turns out that IDEA can connect to the server from any existing User without a password or with any password. Why? Am I misunderstanding something?
I would like to differentiate the rights to connect to the database and issue them only to the application.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Filippenko, 2021-03-10
@DredWulf

You can allow to connect under this user, only from a certain IP (pg_hba.conf file).
If the application server and the DBMS are in the same local network, then you can generally close access to Postgres from the Internet, and if necessary, connect via SSH or a VPN tunnel.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question