Tomcat Realm Security Almost Works but... [message #1837480] |
Sun, 31 January 2021 09:11  |
Eclipse User |
|
|
|
For the most party project is in a pretty good place. I have configured VTS and have a very basic spring rest project running.
The one thing that I struggling with is security. Tomcat has JDBCRealm and DataSourceRealm. I'd prefer to use DataSourceRealm as JDBCRealm is deprecated however at this point I'd settle for either (I suspect it's the same problem).
I'd like to provide a single realm security config for all web bundles. Changes have been made to server-tomcat.xml:
<Realm className="org.apache.catalina.realm.JDBCRealm"
driverName="org.postgresql.Driver"
connectionURL="jdbc:postgresql://172.16.1.50:5432/SC15?user=USERNAME&password=PASSWORD"
digest="MD5"
userTable="devices.vw_security_permissions"
userNameCol="user_name"
userCredCol="user_password"
userRoleTable="devices.vw_security_permissions"
roleNameCol="role_code"
/>
It appears to be trying; when accessing a protected path, the login dialog is displayed. The login fails and the log shows:
[2021-01-31 09:07:01.058] ERROR tp-nio-127.0.0.1-8080-exec-3 org.apache.catalina.core.ContainerBase.[Catalina] Exception performing authentication java.sql.SQLException: org.postgresql.Driver cannot be found by org.apache.catalina_8.5.56 in KernelBundleClassLoader: [bundle=org.apache.catalina_8.5.56]
So now I just need to know how to get the postgres driver to KernelBundleClassLoader. I've tried placing the jar into repository/etc, repository/usr, and the web app lib folder. I've even tried $SERVER/lib but no luck.
Any thoughts from the experts?
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03526 seconds