The custom directory contains the information necessary to build extension for the Shibboleth IdP and SP at the same time they are built, and have these extensions bundled with their respective war file. 1. Directory Structure custom /lib - this directory is where an extension and its libraries are placed after they are built /web - this directory is where an extension's web pages are placed after the extension is built extension-build.properties - this contains default properties needed for the extension build process !!! DO NOT EDIT THIS FILE !!! extension-build.xml - the ant build file for building extensions !!! DO NOT EDIT THIS FILE !!! README.txt - this document 2. Using the Extension Build Process The extension build process depends on an extension having a specific directory structure, so that the extension build file knows where to find everything. The root directory of you extension can be named anything you with, but it must contain the following directories your-extension-directory/ bin/ - [Optional] This directory contains any binary or script files that need to be installed on the filesystem in the IdP or SP home bin directory. This can include subdirectories. The macros $EXTENSION_NAME$ and $IDP_HOME$ or $SP_HOME$ will be exapanded for all files in this directory. etc/ - [Optional] This directory contains any configuration files that need to be installed on the filesystem under the IdP or SP home etc directory. This can include subdirectories. All files will be installed into a subdirectory named after the extension module. The macros $EXTENSION_NAME$ and $IDP_HOME$ or $SP_HOME$ will be exapanded for all files in this directory. lib/ - [REQUIRED if 'src' is present] any third party jars your extension needs src/ - [Optional] your extension's source src-conf/ - [Optional] This directory contains any files which are not java source files but still need to be included in the extension jar (and hence be available on the classpath). This can include subdirectories. The macros $EXTENSION_NAME$ and $IDP_HOME$ or $SP_HOME$ will be exapanded for all files in this directory. tests/ - [Optional] Your extension's JUnit test case source. Test case files MUST end with "Test.java" (i.e. the name must match *Test.java). Resources other than Java source files placed in this directory are added to the unit testing classpath (e.g. if you have "conf/foo.xml" in the tests directory it will appear on the classpath under /conf/foo.xml"). web/ - [Optional] Any web pages, images, JSPs, etc. that should be included with the war build.properties - [REQUIRED] build properties for your extension (see below for required and optional properties) The following directories are created, and destroyed, by the extension build process and as such developers should never rely on them: build, dist, doc/api. Any other directory may be created and bundled with the extension, the build process will simply ignore them. The macro $IDP_HOME$ is only expanded during an IdP install and $SP_HOME$ is only expanded during an SP install. 2.1 Steps for Using the Extensions Build Process I. Create a directory under the custom directory with the structure mentioned above. Any extra directories will be ignored so it is safe to bundle additional information with your extension such as documentation. II. Place your code and other resources in the directory structure you just set up III. Compile and deploy Shibboleth as normal. 2.2 Build File Properties The build file supports the following properties on a per-extension basis. ext.name - [REQUIRED] The name of your resulting extension jar file (.jar will be appended to the name) gen.ext.docs - [Optional] This controls whether Java docs will be generated for your extension. A value of "true" will result in them being generated, any other value will result in them not being generated, if this property is missing the default value of "true" is used. test.ext - [Optional] This controls whether the JUnit tests for your extension are run. A value of "true" will result in them being run, any other value will result in them not being skipped, if this property is missing the default value of "true" is used. 3. Cautionary Note DO NOT include libraries, with your extension, that are included with the Shibboleth IdP or SP. If you do, and there are version mismatches between the two jars, you will get unexpected exceptions during runtime as class versions conflict. 4. Common Errors 4.1 /path/to/extension/lib not found This error occurs because Ant is unable to ignore references to directories of jars that don't exist. Simply create a 'lib' directory in your extension directory structure, you do not have to place anything in it. 4.2 Duplicate web resources If Ant encounters more than one web resource, like a JSP page, with the same name in the same destination in the war it will place N copies of that file in the war (per the zip spec), one for each time it encounters the file. The contents of ALL files will be the contents of the last file with that name that it encountered. So, if you attempt to override the login.jsp file in your extension, for example, your war will have two login.jsp files and both will contain the contents of your extension's log in jsp (because it's encountered after the main shib one).