Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 7c5c23fb

Von Moritz Bunkus vor 7 Tagen hinzugefügt

  • ID 7c5c23fbf6f55a5b428f7d58bddc08938881a31f
  • Vorgänger 222efaf4
  • Nachfolger 82648acc

[LINET] Auth: automatisches SSO mittels gewisser HTTP-Header

Unterschiede anzeigen:

SL/Auth.pm
12 12
use SL::Auth::ColumnInformation;
13 13
use SL::Auth::Constants qw(:all);
14 14
use SL::Auth::DB;
15
use SL::Auth::HTTPHeaders;
15 16
use SL::Auth::LDAP;
16 17
use SL::Auth::Password;
17 18
use SL::Auth::SessionValue;
......
152 153
  foreach my $module (split m{ +}, $self->{module}) {
153 154
    my $config_name;
154 155
    ($module, $config_name) = split m{:}, $module, 2;
155
    $config_name          ||= $module eq 'DB' ? 'database' : lc($module);
156
    $config_name          ||= $module eq 'DB' ? 'database' : $module eq 'HTTPHeaders' ? 'http_headers' : lc($module);
156 157
    my $config              = $::lx_office_conf{'authentication/' . $config_name};
157 158

  
158 159
    if (!$config) {
......
166 167
    } elsif ($module eq 'LDAP') {
167 168
      push @{ $self->{authenticators} }, SL::Auth::LDAP->new($config);
168 169

  
170
    } elsif ($module eq 'HTTPHeaders') {
171
      push @{ $self->{authenticators} }, SL::Auth::HTTPHeaders->new($config);
172

  
169 173
    } else {
170 174
      my $locale = Locale->new('en');
171 175
      $self->mini_error($locale->text('Unknown authenticantion module #1 specified in "config/kivitendo.conf".', $module));
......
228 232
  return $result;
229 233
}
230 234

  
235
sub set_session_authenticated {
236
  my ($self, $login, $result) = @_;
237

  
238
  $self->set_session_value(SESSION_KEY_USER_AUTH() => $result, login => $login, client_id => $self->client->{id});
239
}
240

  
231 241
sub authenticate {
232 242
  my ($self, $login, $password) = @_;
233 243

  
......
252 262
    }
253 263
  }
254 264

  
255
  $self->set_session_value(SESSION_KEY_USER_AUTH() => $result, login => $login, client_id => $self->client->{id});
265
  $self->set_session_authenticated($login, $result);
266

  
256 267
  return $result;
257 268
}
258 269

  

Auch abrufbar als: Unified diff