simpleSAMLphp modules ================================================== This document describes how the module system in simpleSAMLphp works. It descibes what types of modules there are, how they are configured, and how to write new modules. Overview -------- There are currently three parts of simpleSAMLphp which can be stored in modules - authentication sources, authentication processing filters and themes. There is also support for defining hooks - functions run at specific times. More than one thing can be stored in a single module. There is also support for storing supporting files, such as templates and dictionaries, in modules. The different functionalities which can be created as modules will be described in more detail in the following sections; what follows is a short introduction to what you can du with them: - Authentication sources implement different methods for authenticating users, for example simple login forms which authenticate against a database backend, or login methods which use client-side certificates. - Authentication processing filters perform various tasks after the user is authenticated and has a set of attributes. They can add, remove and modify attributes, do additional authentication checks, ask questions of the user, +++. - Themes allow you to package custom templates for multiple modules into a single module. ## Module layout Each simpleSAMLphp module is stored in a directory under the the `modules`-directory. The module directory contains the following directories and files: default-disable : The presence of this file indicates that the module is disabled by default. This module can be enabled by creating a file named `enable` in the same directory. default-enable : The presence of this file indicates that the module is enabled by default. This module can be disabled by creating a file named `disable` in the same directory. dictionaries : This directory contains dictionaries which belong to this module. To use a dictionary stored in a module, the extended tag names can be used: `{::}` For example, `{example:login:hello}` will look up `hello` in `modules/example/dictionaries/login.php`. : It is also possible to specify `:` as the default dictionary when instantiating the `SimpleSAML_XHTML_Template` class. hooks : This directory contains hook functions for this module. Each file in this directory represents a single function. See the hook-section in the documentation for more information. lib : This directory contains classes which belong to this module. All classes must be named in the following pattern: `sspmod__` When looking up the filename of a class, simpleSAMLphp will search for `` in the `lib` directory. Underscores in the class name will be translated into slashes. : Thus, if simpleSAMLphp needs to load a class named `sspmod_example_Auth_Source_Example`, it will load the file named `modules/example/lib/Auth/Source/Example.php`. templates : These are module-specific templates. To use one of these templates, specify `: