lemonldap-ng/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/Apache.pm

51 lines
886 B
Perl
Raw Normal View History

2016-05-22 13:27:37 +02:00
package Lemonldap::NG::Portal::Auth::Apache;
use strict;
use Mouse;
2016-05-22 14:22:59 +02:00
use Lemonldap::NG::Portal::Main::Constants qw(PE_ERROR PE_OK);
2016-05-22 13:27:37 +02:00
2021-02-01 22:30:37 +01:00
our $VERSION = '2.0.12';
2016-05-22 13:27:37 +02:00
2018-02-19 22:11:43 +01:00
extends 'Lemonldap::NG::Portal::Main::Auth';
2016-05-22 13:27:37 +02:00
2016-06-09 20:40:20 +02:00
# INITIALIZATION
2016-05-22 13:27:37 +02:00
sub init {
2021-02-01 22:30:37 +01:00
return 1;
2016-05-22 13:27:37 +02:00
}
2016-06-09 20:40:20 +02:00
# RUNNING METHODS
2016-05-22 13:27:37 +02:00
sub extractFormInfo {
my ( $self, $req ) = @_;
unless ( $req->{user} = $req->env->{REMOTE_USER} ) {
2017-02-15 07:41:50 +01:00
$self->logger->error('Apache is not configured to authenticate users!');
2016-05-22 13:27:37 +02:00
return PE_ERROR;
}
# This is needed for Kerberos authentication
$req->{user} =~ s/^(.*)@.*$/$1/g;
2021-02-01 22:30:37 +01:00
return PE_OK;
2016-05-22 13:27:37 +02:00
}
sub authenticate {
2021-02-01 22:30:37 +01:00
return PE_OK;
2016-05-22 13:27:37 +02:00
}
2016-12-01 23:25:05 +01:00
sub setAuthSessionInfo {
my ( $self, $req ) = @_;
2016-12-26 10:23:35 +01:00
$req->{sessionInfo}->{authenticationLevel} =
$self->conf->{apacheAuthnLevel};
2021-02-01 22:30:37 +01:00
return PE_OK;
2016-12-01 23:25:05 +01:00
}
2016-05-22 13:27:37 +02:00
sub authLogout {
2021-02-01 22:30:37 +01:00
return PE_OK;
2016-05-22 13:27:37 +02:00
}
2016-05-23 23:52:32 +02:00
sub getDisplayType {
return 'logo';
}
2016-05-22 13:27:37 +02:00
1;