9.6.3. Script Handler Module

The script event handler module is used to trigger external scripts in case of certain events.

This way you can even add external actions to your workflows. You could trigger a database dump, an external printing device, a backup and much more.

9.6.3.1. Possible Actions

The actions of the script event handler are the scripts located in a certain script directory. The default script directory is /etc/privacyidea/scripts.

You can change the location of the script directory and give the new directory in the parameter PI_SCRIPT_HANDLER_DIRECTORY in your pi.cfg

file.

9.6.3.2. Possible Options

Options can be passed to the script. Your script has to take care of the parsing of these parameters.

9.6.3.2.1. logged_in_role

Add the role of the logged in user. This can be either admin or user. If there is no logged in user, none will be passed.

The script will be called with the parameter

–logged_in_role <role>

9.6.3.2.2. logged_in_user

Add the logged in user. If there is no logged in user, none will be passed.

The script will be called with the parameter

–logged_in_user <username>@<realm>

9.6.3.2.3. realm

Add --realm <realm> as script parameter. If no realm is given, none will be passed.

9.6.3.2.4. serial

Add --serial <serial number> as script parameter. If no serial number is given, none will be passed.

9.6.3.2.5. user

Add --serial <username>' as script parameter. If no username is given, none will be passed.

Note

A possible script you could call is the privacyidea-get-unused-tokens.