I am trying to embed Realms in Tomcat 7.0.32 (written here in pseudo-XML):
<CombinedRealm> <LockoutRealm> <DataSourceRealm/> </LockoutRealm> <UserDatabaseRealm/> </CombinedRealm>
This doesn't seem to work - is it possible to embed Realms in Tomcat on more than two levels? I get a warning in the logs:
No rules found matching 'Server/Service/Engine/Realm/Realm/Realm'.
The idea is that there are some critical users in the web service that should not be blocked (like DOS for example) and some ordinary users who might have weaker passwords where lockoutRealm should be active. I am sure that other people have been in this situation.
If there is another way to achieve this (e.g. whitelist for LockoutRealm), let me know.
A single sign is also required.
I assume that expanding existing LockoutRealm code with a list of accounts that are never blocked will be an option, but I'm not very interested in writing my own Realm, I would rather not add my own code at Tomcat at this level, as this will complicate the setup for others, and with every Tomcat update it may break, etc.
Thanks for any help!
Here is the relevant part of server.xml in my test configuration:
<Engine name="Catalina" defaultHost="localhost"> <Realm className="org.apache.catalina.realm.CombinedRealm"> <Realm className="org.apache.catalina.realm.LockOutRealm"> <Realm className="org.apache.catalina.realm.DataSourceRealm" dataSourceName="jdbc/authority" userTable="user" userNameCol="username" userCredCol="password" digest="SHA" userRoleTable="user_role" roleNameCol="rolename" /> </Realm> <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/> </Realm> <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"> <Valve className="org.apache.catalina.authenticator.SingleSignOn" /> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log." suffix=".txt" pattern="%h %l %u %t "%r" %s %b" /> </Host> </Engine>
Felixd
source share