- HTML Admin-Manual
- PDF Admin-Manual
- HTML ITSM-Manual
- PDF ITSM-Manual
- HTML Developer-Manual
- PDF Developer-Manual
- HTML Developer-API
Chapter 7. Module Format
7.1. Auth Module
There are several agent authentication modules (DB, LDAP and HTTPBasicAuth) which come with the OTRS framework. It is also possible to develop your own authentication modules. The agent authentication modules are located under Kernel/System/Auth/*.pm. For more information about their configuration see the admin manual. Following, there is an example of a simple agent auth module. Save it under Kernel/System/Auth/Simple.pm. You just need 3 functions: new(), GetOption() and Auth(). Return the uid, then the authentication is ok.
Format:
# --
# Kernel/System/Auth/Simple.pm - provides the simple authentication
# Copyright (C) 2001-2005 Martin Edenhofer martin+code at otrs.org
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (GPL). If you
# did not receive this file, see http://www.gnu.org/licenses/gpl.txt.
# --
# Note:
# available objects are: ConfigObject, LogObject and DBObject
# --
package Kernel::System::Auth::Simple;
use strict;
sub new {
my $Type = shift;
my %Param = @_;
[...]
return $Self;
}
sub GetOption {
my $Self = shift;
my %Param = @_;
# return option
return (PreAuth => 0);
}
sub Auth {
my $Self = shift;
my %Param = @_;
[...]
if ($Authentication) {
return $Param{User};
}
else {
return;
}
}

