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
|
|
|
|
2019-02-12 18:21:38 +01:00
|
|
|
our $VERSION = '2.1.0';
|
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 {
|
|
|
|
1;
|
|
|
|
}
|
|
|
|
|
2016-06-09 20:40:20 +02:00
|
|
|
# RUNNING METHODS
|
|
|
|
|
2016-05-22 13:27:37 +02:00
|
|
|
sub extractFormInfo {
|
|
|
|
my ( $self, $req ) = @_;
|
2017-01-04 17:36:54 +01:00
|
|
|
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;
|
|
|
|
PE_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
sub authenticate {
|
|
|
|
PE_OK;
|
|
|
|
}
|
|
|
|
|
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};
|
2016-12-01 23:25:05 +01:00
|
|
|
PE_OK;
|
|
|
|
}
|
|
|
|
|
2016-05-22 13:27:37 +02:00
|
|
|
sub authLogout {
|
|
|
|
PE_OK;
|
|
|
|
}
|
|
|
|
|
2016-05-23 23:52:32 +02:00
|
|
|
sub getDisplayType {
|
|
|
|
return 'logo';
|
|
|
|
}
|
|
|
|
|
2016-05-22 13:27:37 +02:00
|
|
|
1;
|