I managed to get OTRS working with mod_auth_mellon, the authentication module for apache.
This module authenticates a user against a SAML2 IdP and populates environment vars like REMOTE_USER.
At first I had some troubles because I wasn't aware that OTRS has two distinct user groups, namely agents and customers.
To bootstrap things, I created a bunch of agent and customer accounts in default mode (ie. using the database, as root@localhost).
Then I configured OTRS like this:
Code: Select all
$Self->{'Customer::AuthModule'} = 'Kernel::System::CustomerAuth::HTTPBasicAuth';
$Self->{'CustomerPanelLoginURL'} = 'https://bartali.terena.org/mellon/login?ReturnTo=/customer.pl';
$Self->{'CustomerPanelLogoutURL'} = 'https://bartali.terena.org/mellon/logout?ReturnTo=http://www.terena.org';
$Self->{'AuthModule'} = 'Kernel::System::Auth::HTTPBasicAuth';
$Self->{'LoginURL'} = 'https://bartali.terena.org/mellon/login?ReturnTo=/index.pl';
$Self->{'LogoutURL'} = 'https://bartali.terena.org/mellon/logout?ReturnTo=http://www.terena.org';
This seems to work. https://bartali.terena.org/customer.pl can be accessed by customers, and https://bartali.terena.org/index.pl by agents.
I found out that the same users can access both, provided that they have agent and customer accounts.
The problem now is that if users authenticate OK in the apache module (either to the agent or customer interface), and there is no account yet in OTRS, they get redirected to the authentication again.
Is there a way to automagically create a user account?
The value of REMOTE_USER should be used as the username. There are other apache env vars available for firstname, lastname, email, etc.
Many thanks!!