The Multi Context Broker uses Spring to load several beans used by the login handler:
- A configuration bean
- Multiple beans representing the authentication submodules
A complete example is attached to this page for your reference. The rest of this page will cover individual beans used in the file.
Authentication beans represent the submodules used to authenticate users. They must implement the edu.internet2.middleware.assurance.mcb.authn.provider.MCBSubmmodule Interface. The interface itself is defined as:
By being defined as a bean, the submodule will receive the configured bean name for itself from your mcb-spring.xml file. When building your own submodules, you may also define constructors to pass runtime information via the Spring configuration as constructor arguments using normal Spring syntax.
The bean definition itself for the included JAAS based username/password submodule is:
The bean id value must be unique for each submodule you define. However, it is possible to use the same submodule code to define multiple beans (meaning you could have two or more JAASLoginSubmodules in your file). For the standard JAAS submodule, three constructor arguments are needed, a fourth is optional. The first is the JAAS configuration file itself, the second is the JAAS configuration name (from the configuration file in parameter 1) that will be used. The third is the name of the velocity template to use for the login page. If the fourth parameter is supplied and has a value of true, then the login page template for parameter three is assumed to be a JSP page and is processed as such.
The configuration bean represents the data that is in the MCB multi-context-broker.xml configuration file. By loading it as a bean, the configuration information is available to all parts of the MCB at runtime.
The bean needs two constructor arguments. The first is the path to the configuration file. The standard name for this file is multi-context-broker.xml, but you may use any name you like as long as it is given here. The second constructor is a list of the actual authentication beans you have previously defined in the file. You must list all of them.