Revision f7417f07
Von Moritz Bunkus vor 10 Tagen hinzugefügt
SL/Auth.pm | ||
---|---|---|
use SL::Auth::ColumnInformation;
|
||
use SL::Auth::Constants qw(:all);
|
||
use SL::Auth::DB;
|
||
use SL::Auth::HTTPHeaders;
|
||
use SL::Auth::LDAP;
|
||
use SL::Auth::Password;
|
||
use SL::Auth::SessionValue;
|
||
... | ... | |
foreach my $module (split m{ +}, $self->{module}) {
|
||
my $config_name;
|
||
($module, $config_name) = split m{:}, $module, 2;
|
||
$config_name ||= $module eq 'DB' ? 'database' : lc($module);
|
||
$config_name ||= $module eq 'DB' ? 'database' : $module eq 'HTTPHeaders' ? 'http_headers' : lc($module);
|
||
my $config = $::lx_office_conf{'authentication/' . $config_name};
|
||
|
||
if (!$config) {
|
||
... | ... | |
} elsif ($module eq 'LDAP') {
|
||
push @{ $self->{authenticators} }, SL::Auth::LDAP->new($config);
|
||
|
||
} elsif ($module eq 'HTTPHeaders') {
|
||
push @{ $self->{authenticators} }, SL::Auth::HTTPHeaders->new($config);
|
||
|
||
} else {
|
||
my $locale = Locale->new('en');
|
||
$self->mini_error($locale->text('Unknown authenticantion module #1 specified in "config/kivitendo.conf".', $module));
|
||
... | ... | |
return $result;
|
||
}
|
||
|
||
sub set_session_authenticated {
|
||
my ($self, $login, $result) = @_;
|
||
|
||
$self->set_session_value(SESSION_KEY_USER_AUTH() => $result, login => $login, client_id => $self->client->{id});
|
||
}
|
||
|
||
sub authenticate {
|
||
my ($self, $login, $password) = @_;
|
||
|
||
... | ... | |
}
|
||
}
|
||
|
||
$self->set_session_value(SESSION_KEY_USER_AUTH() => $result, login => $login, client_id => $self->client->{id});
|
||
$self->set_session_authenticated($login, $result);
|
||
|
||
return $result;
|
||
}
|
||
|
Auch abrufbar als: Unified diff
Auth: automatisches SSO mittels gewisser HTTP-Header