Home > wikikonf >  tom/actions/by kikonf > realm



Action : tom.realm   (Category : tom, Name : realm, By : kikonf)
Complete Name :
Version : 4.0        License : Modified BSD License

Purpose of the tom category :
Easy to customize. This category use in background the Kikonf Repoz tools to create and configure Apache Tomcat root installs and Catalina bases at any level (server.xml, hosts or defaults).
You can use it to manage the whole Tomcat Architecture.

Purpose of this realm plugin : This Action configures a Tomcat Realm.

The following shows in what part of a typical Architecture is likely to be found, the Resource configured by Action : tom.realm

This Action configures a Tomcat Realm.

In the Tomcat scheme, the Realm Name is taken from the <realm-name>
element of the web application's <login-config>.  If not set the default is "Authentication required".


A Realm is a store of usernames and passwords that identify valid users of a web application
plus an enumeration of the list of roles associated with each valid user.


a. The Tomcat Administrator configures the store for one of the 6 kinds of Realms provided by tomcat.
b. The Tomcat Administrator tells Tomcat to use this store using the Kikonf Action: realm.
c. The Developpers, into the WebApplication web.xml file :
_  declare the Realm and the Authentification  mechanism to use for their Application
using the tag login-config.
In this sample "myrealm" suppersedes the default Realm Name: Authentication required.
_ declare the Role they need using the tag security-role.
_ declare the Autorisation level they grant on the Web Application component using the tag ecurity-constraint.


Tomcat 5 provide a sample Application using Realm at http://localhost:8080/jsp-examples/security/protected/.

4. The Tomcat Authentification mechanism

This excerpt from the Tomcat official site, realm-howto.html explains
how Tomcat deals with Authentification.

When a user attempts to access a protected resource for the first time,
Tomcat 5 will call the authenticate() method of this Realm.
Once a user has been authenticated, the user (and his or her associated roles) are cached within Tomcat for the duration
of the user's login. (For FORM-based authentication, that means until the session times out or is invalidated;
for BASIC authentication, that means until the user closes their browser). The cached user is not saved and restored
across sessions serialisations.

Trademarks :
  • "Apache", "Apache Tomcat" and "Tomcat" are trademarks of the Apache Software Foundation.
  • "Java" and "JVM" are a registred trademarks of Oracle and/or its affiliates.
  • Other names may be trademarks of their respective owners.

Copyright © 2011 - Patrick Placidoux, Hélène Malamoud