i use leaflet, geoserver and js. And also using tomcat
I have more than 400 users and each has its own role, adding more than 400 users to geoserver and configuring them individually is too long.
The user is currently logged in like this:
The question is, if there is any way to get the data of an authorized user and apply roles and filters to it?
I will also say that the users are in the postgres database
Adding an authentication using a JDBC database to GeoServer is a very similar process to adding an LDAP provider. While logged in as admin go to the User, Groups and Roles page from the security menu and choose Add new from the User Group Services menu. Then select the JDBC option, you can then give this provider a new name.
Then you should select the relevant JDBC driver for your database (you may need to add the jar containing that driver to the GeoServer WEB-INF/lib folder). You then need to add the connection URL for your database (e.g. jdbc:postgresql://localhost:5432/ian). It is probably a good idea to make a quick test using a known user password combination in the boxes below. Assuming that works click save to make the change. If you don’t already have any tables with users in then check the create database tables box (don’t worry about the DDL files). Then press save, and go back into the service by clicking on it’s name in the table.
You can then add new roles to the service. Now, you need to create a new Basic username/Password authentication provider. You will now need to scroll down to the Authentication providers panel and move the new provider across to the right hand list. You then need to click on the new provider and set the User Group Service to point to the JDBC one you just created.
There are many more instructions and tutorials in the GeoServer manual.