Revision 7c5c23fb
Von Moritz Bunkus vor 7 Tagen hinzugefügt
SL/Dispatcher/AuthHandler/None.pm | ||
---|---|---|
1 | 1 |
package SL::Dispatcher::AuthHandler::None; |
2 | 2 |
|
3 | 3 |
use strict; |
4 |
use parent qw(SL::Dispatcher::AuthHandler::Base); |
|
4 | 5 |
|
5 |
use parent qw(Rose::Object);
|
|
6 |
use SL::Auth::Constants;
|
|
6 | 7 |
|
7 | 8 |
sub handle { |
8 |
%::myconfig = User->get_default_myconfig; |
|
9 |
my ($self) = @_; |
|
10 |
|
|
11 |
|
|
12 |
my ($http_auth_login, $http_auth_password) = $self->_parse_http_basic_auth; |
|
13 |
my ($http_headers_client, $http_headers_login) = $self->_parse_http_headers_auth; |
|
14 |
|
|
15 |
my $client_id = $http_headers_client // $::auth->get_default_client_id; |
|
16 |
my $login = $http_headers_login // $http_auth_login; |
|
17 |
|
|
18 |
if ($client_id && $login) { |
|
19 |
$::auth->set_client($client_id); |
|
20 |
%::myconfig = User->get_default_myconfig($::auth->read_user(login => $login)); |
|
21 |
|
|
22 |
$::auth->create_or_refresh_session; |
|
23 |
$::auth->set_session_value('client_id', $client_id); |
|
24 |
$::auth->set_session_value('login', $login); |
|
25 |
|
|
26 |
$::auth->set_session_authenticated($login, SL::Auth::Constants::SESSION_OK()); |
|
27 |
|
|
28 |
} else { |
|
29 |
%::myconfig = User->get_default_myconfig; |
|
30 |
} |
|
31 |
|
|
9 | 32 |
return 1; |
10 | 33 |
} |
11 | 34 |
|
Auch abrufbar als: Unified diff
[LINET] Auth: automatisches SSO mittels gewisser HTTP-Header