Commit bbc1b685 authored by Christophe Maudoux's avatar Christophe Maudoux 🐛

Merge remote-tracking branch 'upstream/master'

parents 03c187ce c673be7c
......@@ -244,6 +244,8 @@ sub defaultValues {
'SMTPServer' => '',
'SMTPTLS' => '',
'SSLAuthnLevel' => 5,
'SSLVar' => 'SSL_CLIENT_S_DN_Email',
'SSLVarIf' => {},
'successLoginNumber' => 5,
'timeout' => 72000,
'timeoutActivity' => 0,
......
......@@ -3004,19 +3004,19 @@ qr/(?:(?:https?):\/\/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.]
'default' => 0,
'select' => [
{
'k' => 0,
'k' => '0',
'v' => 'unsecuredCookie'
},
{
'k' => 1,
'k' => '1',
'v' => 'securedCookie'
},
{
'k' => 2,
'k' => '2',
'v' => 'doubleCookie'
},
{
'k' => 3,
'k' => '3',
'v' => 'doubleCookieForSingleSession'
}
],
......@@ -3146,10 +3146,12 @@ qr/^(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-
'type' => 'url'
},
'SSLVar' => {
'type' => 'text'
'default' => 'SSL_CLIENT_S_DN_Email',
'type' => 'text'
},
'SSLVarIf' => {
'type' => 'keyTextContainer'
'default' => {},
'type' => 'keyTextContainer'
},
'staticPrefix' => {
'type' => 'text'
......
......@@ -1054,7 +1054,7 @@ sub attributes {
default => 1,
documentation => 'Upgrade session activation',
},
# 2F
max2FDevices => {
default => 10,
......@@ -1066,7 +1066,7 @@ sub attributes {
type => 'int',
documentation => 'Maximum 2F devices name length',
},
# U2F
u2fActivation => {
type => 'boolOrExpr',
......@@ -2401,8 +2401,14 @@ m{^(?:ldapi://[^/]*/?|\w[\w\-\.]*(?::\d{1,5})?|ldap(?:s|\+tls)?://\w[\w\-\.]*(?:
default => 5,
documentation => 'SSL authentication level',
},
SSLVar => { type => 'text', },
SSLVarIf => { type => 'keyTextContainer', },
SSLVar => {
type => 'text',
default => 'SSL_CLIENT_S_DN_Email'
},
SSLVarIf => {
type => 'keyTextContainer',
default => {}
},
sslByAjax => {
type => 'bool',
documentation => 'Use Ajax request for SSL',
......
......@@ -375,6 +375,7 @@ llapp.controller 'SessionsExplorerCtrl', ['$scope', '$translator', '$location',
$scope.waiting = false
, (resp) ->
$scope.waiting = false
# Colorized link
$scope.activeModule = "2ndFA"
$scope.myStyle = {color: '#ffb84d'}
......
......@@ -751,6 +751,7 @@ llapp.controller 'TreeCtrl', [
$scope.form = 'home'
$scope.waiting = false
, readError
# Colorized link
$scope.activeModule = "conf"
$scope.myStyle = {color: '#ffb84d'}
......
......@@ -241,6 +241,7 @@ llapp.controller 'NotificationsExplorerCtrl', [ '$scope', '$translator', '$locat
$scope.waiting = false
, (resp) ->
$scope.waiting = false
# Colorized link
$scope.activeModule = "notifications"
$scope.myStyle = {color: '#ffb84d'}
......
......@@ -396,6 +396,7 @@ llapp.controller 'SessionsExplorerCtrl', ['$scope', '$translator', '$location',
$scope.waiting = false
, (resp) ->
$scope.waiting = false
# Colorized link
$scope.activeModule = "sessions"
$scope.myStyle = {color: '#ffb84d'}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -13,16 +13,9 @@ our $VERSION = '2.0.0';
extends 'Lemonldap::NG::Portal::Main::Auth';
# PROPERTIES
has SSLField => ( is => 'rw' );
# INITIALIZATION
sub init {
my ($self) = @_;
$self->SSLField( $self->conf->{SSLVar} ||= 'SSL_CLIENT_S_DN_Email' );
$self->conf->{SSLVarIf} ||= {};
return 1;
}
......@@ -30,7 +23,7 @@ sub init {
# @return Lemonldap::NG::Portal constant
sub extractFormInfo {
my ( $self, $req ) = @_;
my $field = $self->SSLField;
my $field = $self->conf->{SSLVar};
if ( $req->env->{SSL_CLIENT_I_DN}
and my $tmp =
$self->conf->{SSLVarIf}->{ $req->env->{SSL_CLIENT_I_DN} } )
......
......@@ -74,7 +74,6 @@ sub new {
weaken $self->{portal};
# Setting default LDAP password storage encoding to utf-8
$self->{conf}->{ldapPwdEnc} ||= 'utf-8';
return $self;
}
......
......@@ -23,9 +23,31 @@ ok(
),
'Auth query'
);
expectOK($res);
expectCookie($res);
count(1);
$client = LLNG::Manager::Test->new(
{
ini => {
logLevel => 'error',
useSafeJail => 1,
authentication => 'SSL',
userDB => 'Null',
}
}
);
ok(
$res = $client->_get(
'/', custom => { SSL_CLIENT_S_DN_Email => 'dwho' }
),
'Auth query'
);
expectOK($res);
my $id = expectCookie($res);
expectCookie($res);
count(1);
clean_sessions();
done_testing( count() );
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment