JAAS: Make application use Tomcat authentication settings -
is possible make web application uses jaas authenticate via tomcats default authentication method.
to illustrate: tomcat uses tomcat_users.xml authentications. web application has defined own method in jaas.cfg. how configure jaas.cfg in such way uses tomcat's method in when configuration in tomcat changes application's authentication method switches aswell.
current config looks this:
bonitaauth { org.ow2.bonita.identity.auth.bonitaidentityloginmodule required; }; bonitastore { org.ow2.bonita.identity.auth.localstorageloginmodule required; }; bonitaauth-default { org.ow2.bonita.identity.auth.bonitaidentityloginmodule required domain="default"; org.ow2.bonita.identity.auth.localstorageloginmodule required domain="default"; }; bonitastore-default { org.ow2.bonita.identity.auth.localstorageloginmodule required domain="default"; }; /** * used rest server */ bonitarestserver { org.ow2.bonita.identity.auth.bonitarestserverloginmodule required logins="restuser" passwords="restbpm" roles="restuser"; };
the tomcat user repository defined tomcat realms. tomcat_users.xml file used memoryrealm. use jaas configuration (jaas.cfg) configure jaasrealm: http://tomcat.apache.org/tomcat-7.0-doc/realm-howto.html#jaasrealm
it possible use java ee authentication , implement own realm. have 3 options:
- implement tomcat
realminterface http://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/realm.html - extend
realmbasehttp://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/realm/realmbase.html) - extend
jaasrealmhttp://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/realm/jaasrealm.html
configure own realm in server.xml
<realm classname="org.myrealm"/> tomcat call authenticate method http://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/realm/realmbase.html#authenticate%28java.lang.string,%20java.lang.string%29
in method can call jaas authentication.
Comments
Post a Comment