Question

I have successfully implemented a mysql server as a JDBCRealm for authentication in Tomcat 7. What I can't figure out is if it's possible to use different schemas or tables for different web apps. In essence, to define different JDBCRealms for different web apps. This way I can have different user credential schemas/tables to separate the web apps. I know this can be simulated with roles in Tomcat. I was hoping to find a way to make the web apps portable with their associated schemas. I have no idea how this could be achieved, so I have no code to post. Either code or even better, a topic to investigate further would be helpful.

Était-ce utile?

La solution

You have to configure your Realm inside the Context of your application. This way, if you have multiple applications deployed into the same instance of Tomcat, each of them would have its own realm. Also, encapsulating authentication/authorization details in the application context file makes your application more portable and easier to deploy.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top