Hi i have an application in the tomcat webapps folder which authorises using FORM based Authentication and i added the username and roles in the tomcat-users.xml file and the container authenticates and authorises the user logged in. Now i am adding another application in the webapps folder which works using JDBC realm where i created tables containig username and password and roles in oracle database, after i configure my server.xml file so that the new application uses these tables to authenticate and authorise users , will this effect my old application how will the container recognise this new application is to be work using JDBC realm and the old one to work with memory realm?
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35241
7
posted
0
The Tomcat docs indicate that it is possible to set up realms per context (by nesting the Realm element inside of the Context element). Have you tried that?
(Note that the default configuration of server.xml has a Realm element inside the Engine element, which will cause all web apps to use the same Realm; you'll need to change that.)
Now when i click the login button without providing the username and password the control does not goes to the error.html file ... Also i want to know that the configuration of the realm for the context is correct or i am missing out something.
Well, the other thing I do is define the realm in each context. A quick re-read of your initial message gives me the impression that you're activating 2 different realms at the server engine level and expecting magic to connect the right webapp to the right realm. There isn't any magic, so you'd need to define the realm for the context of the webapp rather than in server.xml.
This is all there is. Nothing in server.xml, nothing under Engine. I just put this file under the name TOMCAT_HOME/conf/Catalina/localhost/jtaonthemove.xml