D
D
detected_pro2018-09-25 15:50:57
Hibernate
detected_pro, 2018-09-25 15:50:57

How to make authorization and authentication through a DBMS?

Hello.
There is an application that is written in spring rest, hibernate, postgres and more. There was a task - differentiation of access rights through the DBMS (namely through the DBMS, and not programmatically)
The principle is something like this:

  1. The client sends data from the database (not in the users table, but created by CREATE USER in the DBMS)
  2. A new connection is created (connection info) with the passed data, i.e. sessionFactory, dataSource, etc.

It is possible to intercept all requests before the controllers are executed, and also receive the transmitted data from the user there, but here's how to create a new connection (the same beans) with new data, and then Autowired them. Either do: 1 user = 1 sessionFactory
I tried to dig towards SCOPE, I thought about integration with spring security, as well as about my map, but then there are many problems associated with autowired, annotations, transactions, etc.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question